The 10 Coolest New Features in R15 of ANSYS Mechanical APDL

On Tuesday we posted on what I thought were the 10 coolest features in ANSYS Mechanical for R15. Now it is time to take a good look at ANSYS Mechanical APDL, or MAPDL (classic ANSYS, black window ANSYS, or my favorite: ANSYS).  The developers have been very busy and added a lot of useful features, and there are a large number of “Oh Yes!” capabilities in this release that different groups of users will be very excited about.  For this posting though, we are going to stay focused on the things that impact larger groups of users and/or expand capability in the code.  As always, you can learn more by attending one of the many upcoming ANSYS webinars or reading the release notes in the help.

image1: Rezoning Enhancements and Additions

This is my favorite change in R15, a mix of some improvements and some new capabilities. The whole idea of rezoning is that when you have a part that sees a large amount deformation, the mesh often gets very distorted. It often gets so distorted that the elements are no longer accurate and crazy strains are calculated and the element literally blows up.  Or it turns inside out and generates an error in the solver.

Rezoning has been around for a while but at this release some holes are plugged and some big advances are made.  The first change was a hole plug, you can now rezone areas that contain surface effect  (SURF153/154) elements.  It is very common to have that type of load on highly distorted geometry, so this is welcomed.

The next change was adding mesh splitting for 3D  tetrahedral elements. This is used for manual rezoning with the REMESH command. It was available before with 2D elements.  The 2D example from the manual shows it best:

image

The advantage of this approach is that the subsequent stress field that is placed upon the new mesh is already accurate at the nodes that existed for the original mesh, and are fairly accurately interpolated for the new nodes.  When you read in a completely new mesh, you have to interpolate the stress field and then iterate till the stresses are accurate.  This approach can be much faster.

The third and best addition is Automatic Rezoning or Mesh Nonlinear Adaptivity.  This process is completely automatic and does not require the user interaction that rezoning does.  Both splitting and remeshing are used. You can turn remeshing on based upon position, energy levels, or contact conditions.

Here is an example from the user manual:

seal2

And here is an example that ANSYS, Inc. is showing on the new :

Seal_Squish1

image2: Bolt Thread Modeling

Modeling bolt threads.  Classic newby mistake right?  They model threads on 37 bolts and then try and set up contact on all of them.  Never goes well does it. ANSYS MAPDL has had a bolt modeling capability for some time that allows you to simulate a bolt as a cylinder with preload and everything. But what that approximation missed was the fact that the contact is at an angle that is not normal to the cylinder surface.

At R15 you can now specify your thread geometry and the contact algorithm will calculate the proper normal and contact pattern for the contact forces. Much more efficient. There is a great example in the Technology Demonstration Guide, Section 39, showing all three approaches: model the threads in the mesh, use the new contact threads, or just bond the threaded area.

image

Needless to say we will be doing an in-depth posting on this one in the future.

image3: Mode-Superposition for Harmonic Analysis of Cyclic Structures

I started my career in turbomachinary and from day one, one of the holy grails was to be able to do a harmonic analysis using blade pressure loads from a CFD run: getting the actual stresses in the blades caused by the varying aerodynamic load as they spun around and dealt with variations caused by passing frequencies and resonance in the flow itself.  It was always doable as a full 360 model on both the CFD and structural side. And you could have done it using the full method for a few releases.  But now we can use cyclic symmetry and mode-superposition.

The ANSYS MAPDL side of things is released in R15.  You can take your complex loading info from CFD and apply that as a load on your blades using the new /MAP pre-processor (see below), a bit of a pain to do in the past.  The other big change was making it all work with modal-superposition.  The grail is almost complete.

image4: Arc Length

This is one of those things buried in the code that the user really doesn’t have to do anything to benefit from. If you are not familiar with the method, it is an approach used on non-linear problems using the Newton-Raphson method. Most solves use other methods,  but for things like non-linear buckling it is a better method. Check out 14.12 in the Theory Reference for the math and all that.

The bottom line at R15 is that they changed the algorithm to use the Crisfield Method and to avoid Driftback.  What it means to you the user is those nasty non-linear buckling problems that always seem to have a hard time converging, or that require really small steps to converge, should converge now or converge faster.

image5: Mode Selection

This is another one of those advanced options that users of other solvers have been asking for in the past. When you do a modal analysis that produces a ton of modes, you often want to ignore the majority of them and focus on the few modes that are strong or that get excited.  In the past you could specify a range only, and only one range. At R15 you can now select which modes to use in modal-superposition analysis.  You can decide which modes to use based on the modal effective mass, the mode coefficient, or the DDAM Procedure. Or, if you have your own criteria, you can use APDL to create a table that specifies a 1 for keep, and a 0 for toss. Very handy.

image6: Acoustics Enhancements

This is really not one new feature, but an overall continuation of adding functionality to the acoustics capability in ANSYS MAPDL. For decades, this capability was not really focused on advanced acoustic modeling. But over the last couple of releases we have seen added functionality that put the functionality on a par with specialty acoustics codes.

The key enhancements at R15 are:

  • Frequency-dependent acoustic material properties
  • Surface impedance can be frequency-dependent
  • A new boundary layer impedance (BLI) model is available for visco-thermo fluids modeling
  • A wider range of units are now supported for acoustics, including support for user defined units (/UNITS)
  • Many enhancements for coupling acoustics with CFD for FSI
  • New postprocessing commands for calculating acoustics specific information like sound power level, A-weighted sound pressure level (dBA), and return loss, and transmission loss, amongst others.

image

image7: Shape Memory on Beam, Shell and Plane Strain

For whatever reason shape memory alloys have always fascinated me, and being able to simulate them accurately is very important for those that use the material in their products. Development has been adding more and more functionality in this area for many releases.  The material has two unique properties: it is super elastic and it has a memory effect.

With R15 development rounds out the capabilities with full support for beam and shell elements, adding the memory behavior.  This is important, and warrants top 10 status for me, because many of the geometries we have worked on that use Nitinol (the most common shape memory alloy) are made with wires.  In the past you had to model them in 3D, now we can use beams.  Faster, more accurate, etc…

image

image8: RSTMAC to Experimental Data

Something we should all be doing more is comparing our FEA results to experimental data. One excuse we often use is that it is too hard to compare the data from a vib test to our modal analysis results. Well, that is no longer to. The RSTMAC command has been modified to not only compare to ANSYS result files, but to also read the old Universal file format for results. Yipee!

Why that format? Because back in the days when SDRC was SDRC and IDEAS was their prep/post tool, they had some awesome result comparison tools. So a lot of test software out there writes to the file that IDEAS read, the Universal file.  If your software does not write to a Universal file, the key info you need is in the user manual: Basic Analysis Guide, section 7.3.8.5.  and here is a link to some documentation on it.

image

image9: Mapping Processor

It has been a long time since ANSYS, Inc. has added a new processor to ANSYS Mechanical APDL.  /PREP7, /SOLVE, /POST26.  So it was kind of cool to see that they are creating a new mapping processor called /MAP that will be a place for you to do load mapping. At this initial release, it maps surface pressures as a point cloud from a CFD model onto your mechanical model.

Under the hood it is actually just the algorithms used in the *MOPER APDL function.  But now it is exposed in through its own set of commands so that users don’t have to script their load mapping. And it supports imaginary loading for that fancy cyclic-symmetry stuff some of us need to do. As you can imagine, this needs its own article, but here are the high points:

  • Enter the processor with /MAP
  • Your model must have surface effect elements (SURF154) elements paved onto the outside of where you want the pressures.

 

  • Specify the nodes you want to map the pressures on to with the TARGET command
  • You can provide pressures in a variety of formats (specified with the FTYPE command):

 

  • CFX Transient Blade Row format is made by CFX and contains real and imaginary terms
  • The standard output file from ANSYS CFDPost
  • A fixed format file that has x, y, z, and pressure, and yes, you can specify the actual format in FORTRAN using the READ command
  • And of course the trusty comma delimited file format: x, y, z, pressure.

 

  • The READ command specifies some other parameters and reads in the point based pressure data.
  • They have given us a PLGEOM command to view the target nodes and the point cloud on top of each other so you can see if things are aligned
  • A whole slew of /PREP7 like commands to edit and move your point cloud data. Basically they are treated as nodes and you manipulate them like nodes. They are just nodes with a pressure assigned to them.
  • When everything is good, use MAP to actually do the interpolation.
  • View the results with PLMAP
  • When you are happy, save the pressures as SFE commands using WRITEMAP

 

There is no GUI interface for this yet.  It was put into place to support some advanced FSI modeling of turbomachinery, but it benefits all users.  We hope to see more in this new module in future releases.  Here is an example we were playing with at PADT:

image

image

Image10: Performance Enhancements, Including GPU Stuff

Last but certainly not least are the enhancements to solver performance that we have come to expect. New compilers, optimized code, and new hardware all come together to deliver better bang for your ANSYS buck.  There is a ton in there, all documented in section 2.3.1 of the ANSYS, Inc. Release Notes part of the help.  The highlights are:

  • The sparse solver now has some sophisticated error detection for handling singular or near singular matrices.  This should keep you from solving poorly constrained models, or models with really messed up elements. Do note, some models that ran in the past, maybe with a warning, will now not solve. This is a good thing since the matrices are not good
  • Better domain decomposition for distributed ANSYS, especially for larger core counts.
  • The subspace method has been added for solving modal analysis.  It is well suited for larger problems and runs well distributed.
  • Switching to the new Intel compiler has resulted in a 30% faster solve time on some problems when using Sandy Bridge Intel processors.
  • Harmonic analyses solves using the full method have been improved, resulting into up to 40% improvements in solve time.
  • The Intel Xeon Phi coprocessor is now supported – we have no data yet on the performance but will try and get some as soon as we can
  • The latest NVIDIA Kepler GPU’s are now supported and the sparse solver has been improved again to take advanged of the Kepler GPU’s.

CUBE HVPC 512 Core System

Thoughts

The hard part for me in writing this posting was picking the top 10. There are a lot of significant enhancements but few are world changing. Most improve existing technologies, provide functionality for a subset of users, or fill a hole in capability.  Taken as a whole though, they show ANSYS, Inc.’s strong commitment to core technology: new elements, new material models, faster solves, expanded advanced capability, etc…

The end result is giving greater power to the user through greater depth and breadth.  And in the end, isn’t this why we use ANSYS Mechanical APDL in the first place – the incredible breadth and depth of capability it offers?  Scrolling back up through the images you have to admit, this is some pretty cool stuff.

This May Be the Fastest ANSYS Mechanical Workstation we Have Built So Far

The Build Up

Its 6:30am and a dark shadow looms in Eric’s doorway. I wait until Eric finishes his Monday morning company updates. “Eric check this out, the CUBE HVPC w16i-k20x we built for our latest customer ANSYS Mechanical scaled to 16 cores on our test run.” The left eyebrow of Eric’s slightly rises up. I know I have him now I have his full and complete attention.

Why is this huge news?

This is why; Eric knows and probably many of you reading this also know that solving differential equations, distributed, parallel along with using graphic processing unit makes our hearts skip a beat. The finite element method used for solving these equations is CPU intensive and I/O intensive. This is headline news type stuff to us geek types. We love scratching our way along the compute processing power grids to utilize every bit of performance out of our hardware!

Oh and yes a lower time to solve is better! No GPU’s were harmed in this tests. Only one NVIDIA TESLA k20X GPU was used during the test.

Take a Deep Breath and Start from the Beginning:

I have been gathering and hording years’ worth of ANSYS mechanical benchmark data. Why? Not sure really after all I am wanna-be ANSYS Analysts. However, it wasn’t until a couple weeks ago that I woke up to the why again. MY CUBE HVPC team sold a dual socket INTEL Ivy bridge based workstation to a customer out of Washington state. Once we got the order, our Supermicro reseller‘s phone has been bouncing of the desk. After some back and forth, this is how the parts arrive directly from Supermicro, California. Yes, designed in the U.S.A.  And they show up in one big box:

clip_image002[4]

Normal is as Normal Does

As per normal is as normal does, I ran the series of ANSYS benchmarks. You know the type of benchmarks that perform coupled-physics simulations and solving really huge matrix numbers. So I ran ANSYS v14sp-5, ANSYS FLUENT benchmarks and some benchmarks for this customer, the types of runs they want to use the new machine for. So I was talking these benchmark results over with Eric. He thought that now is a perfect time to release the flood of benchmark data. Well some/a smidge of the benchmark data. I do admit the data does get overwhelming so I have tried to trim down the charts and graphs to the bare minimum. So what makes this workstation recipe for the fastest ANSYS Mechanical workstation so special? What is truly exciting enough to tip me over in my overstuffed black leather chair?

The Fastest Ever? Yup we have been Changed Forever

Not only is it the fastest ANSYS Mechanical workstation running on CUBE HVPC hardware.  It uses two INTEL CPU’s at 22 nanometers. Additionally, this is the first time that we have had an INTEL dual socket based workstation continue to gain faster times on and up to its maximum core count when solving in ANSYS Mechanical APDL.

Previously the fastest time was on the CUBE HVPC w16i-GPU workstation listed below. And it peaked at 14 cores. 

Unfortunately we only had time before we shipped the system off to gather two runs: 14 and 16 cores on the new machine. But you can see how fast that was in this table.  It was close to the previous system at 14 cores, but blew past it at 16 whereas the older system actually got clogged up and slowed down:

  Run Time (Sec)
Cores Used Config B Config C Config D
14 129.1 95.1 91.7
16 130.5 99 83.5

And here are the results as a bar graph for all the runs with this benchmark:

CUBE-Benchmark-ANSYS-2013_11_01

  We can’t wait to build one of these with more than one motherboard, maybe a 32 core system with infinband connecting the two. That should allow some very fast run times on some very, very large problems.

ANSYS V14sp-5 ANSYS R14 Benchmark Details

  • Elements : SOLID187, CONTA174, TARGE170
  • Nodes : 715,008
  • Materials : linear elastic
  • Nonlinearities : standard contact
  • Loading : rotational velocity
  • Other : coupling, symentric, matrix, sparse solver
  • Total DOF : 2.123 million
  • ANSYS 14.5.7

Here are the details and the data of the March 8, 2013 workstation:

Configuration C = CUBE HVPC w16i-GPU

  • CPU: 2x INTEL XEON e5-2690 (2.9GHz 8 core)
  • GPU: NVIDIA TESLA K20 Companion Processor
  • GRAPHICS: NVIDIA QUADRO K5000
  • RAM: 128GB DDR3 1600Mhz ECC
  • HD RAID Controller: SMC LSI 2208 6Gbps
  • HDD: (os and apps): 160GB SATA III SSD
  • HDD: (working directory):6x 600GB SAS2 15k RPM 6Gbps
  • OS: Windows 7 Professional 64-bit, Linux 64-bit
  • Other: ANSYS R14.0.8 / ANSYS R14.5

Here are the details from the new, November 1, 2013 workstation:

Configuration D = CUBE HVPC w16i-k20x

  • CPU: 2x INTEL XEON e5-2687W V2 (3.4GHz)
  • GPU: NVIDIA TESLA K20X Companion Processor
  • GRAPHICS: NVIDIA QUADRO K4000
  • RAM: 128GB DDR3 1600Mhz ECC
  • HDD: (os and apps): 4 x 240GB Enterprise Class Samsung SSD 6Gbps
  • HD RAID CONTROLLER: SMC LSI 2208 6Gbps
  • OS: Windows 7 Professional 64-bit, Linux 64-bit
  • Other: ANSYS 14.5.7

You can view the output from the run on the newer box (Configuration D) here:

Here is a picture of the Configuration D machine with the info on its guts:

clip_image006[4]clip_image008[4]

What is Inside that Chip:

The one (or two) CPU that rules them all: http://ark.intel.com/products/76161/

Intel® Xeon® Processor E5-2687W v2

  • Status: Launched
  • Launch Date: Q3’13
  • Processor Number: E5-2687WV2
  • # of Cores: 8
  • # of Thread: 16
  • Clock Speed: 3.4 GHz
  • Max Turbo Frequency: 4 GHz
  • Cache:  25 MB
  • Intel® QPI Speed:  8 GT/s
  • # of QPI Link:  2
  • Instruction Se:  64-bit
  • Instruction Set Extension:  Intel® AVX
  • Embedded Options Available:  No
  • Lithography:  22 nm
  • Scalability:  2S Only
  • Max TDP:  150 W
  • VID Voltage Range:  0.65–1.30V
  • Recommended Customer Price:  BOX : $2112.00, TRAY: $2108.00

The GPU’s that just keep getting better and better:

Features

TESLA C2075

TESLA K20X

TESLA K20

Number and Type of GPU

FERMI

Kepler GK110

Kepler GK110

Peak double precision floating point performance

515 Gflops

1.31 Tflops

1.17 Tflops

Peak single precision floating point performance

1.03 Tflops

3.95 Tflops

3.52 Tflops

Memory Bandwidth (ECC off)

144 GB/sec

250 GB/sec

208 GB/sec

Memory Size (GDDR5)

6GB

6GB

5GB

CUDA Cores

448

2688

2496

clip_image012[4]

Ready to Try one Out?

If you are as impressed as we are, then it is time for you to try out this next iteration of the Intel chip, configured for simulation by PADT, on your problems.  There is no reason for you to be using a CAD box or a bloated web server as your HPC workstation for running ANSYS Mechanical and solving in ANSYS Mechanical APDL.  Give us a call, our team will take the time to understand the types of problems you run, the IT environment you run in, and custom configure the right system for you:

http://www.padtinc.com/products/hardware/cube-hvpc,
email: garrett.smith@padtinc.com,
or call 480.813.4884

/HBC: One of Those Little Known Commands

The other day we received a tech support call requesting a way to remove the space between the element faces on a pressure plot.  He wanted this so that he could get a contour plot without seeing the contours of the elements on the back side of the part. So I built my trusty test block and applied a pressure. By turning on the pressure load symbols with  the /PSF command, also under PlotCrtls > Symbols, you can get plots like this.

image

Face Outlines (/PSF,1,1)

 

image

Arrows (/PSF,1,2)

 

image

Contours (/PSF,1,3)

Of course the customer was using this last contour plot option, but as you can see below, if you have pressure on both sides of the model, then the backside pressures show through the gaps. The plot can get a bit confusing. So after some digging, starting with the /PSF command, and not finding any reference on how to change the plot behavior, I asked around if anyone else had a way to do it, other than my first inclination which was to write a macro. So as I reverted to creating a macro, to do what should be a simple task, I thought, “No, there HAS to be an easier way.” Of course there is.

image

The one thing I’ve learned over the years… Well, yes, I’ve learned more than ONE thing, but I’m trying to make a point here… The one thing I’ve learned over the years, is that no matter how much I learn, there is always someone who know more than me.  So I asked Sheldon! (Not the Sheldon on Big Bang Theory; ANSYS, Inc’s very own Sheldon Imaoka.) I thought, “Surely he will know some undocumented command to save me time.  It took him all of three minutes to get back to me with the /HBC command. It is a fully documented, but seldom used, command that is hidden in the recesses of the Command Reference that determines how boundary condition symbols are displayed. When turned on, it will “use an improved pressure contour display.” So you go from the picture on the top, to the picture on the bottom.

imageimage

So I learned two new things. One is the /HBC command can give you nicer looking plots. The other, and even more useful thing, is to click the links on the help page at the upper right corner.

image

For if I did, I would have found the /HBC command on my own.

image

It looks like I need to sit down with a nice cup of hot chocolate* and the Command Reference and just scan the listing for commands that I don’t recognize and learn what they do.  Oh, what I go through for you people. Well, I’ll just make sure that it’s really good hot chocolate*.   I’ll write a new post from time to time on cool commands I find useful.

Have a great day!!!

*It’s 85 degrees here this week and I really meant iced tea, but I didn’t want to rub it in. Smile

Making APDL Parameters Available in the ANSYS Parameter Manager or DesignXplorer: Prep, Solve, and Post

This is one of those questions that comes up every once in a while that is not so obvious at first glance, but that is simple once you understand how ANSYS Mechanical interacts with ANSYS Mechanical APDL.  After a couple of email exchanges around a tech support question, we thought it would be good to share with everyone.

Before we get started, if you need a refresher on Command Objects in ANSYS Mechanical, the way in which you send APDL commands to the ANSYS Mechanical APDL solver, here is a seminar from a couple of years ago that covers the whole deal:

The basic problem is this: you have an APDL script you execute as a command object that does some sort of model interrogation or stores the result of some calculation, and you want to use that parameter in the parameter manager or in DesignXplorer.  If you look at the details view for a command object you will notice that it only supports input parameters: ARG1-ARG9.

image

If you look at the example (silly) macro you will see that it:

  1. Grabs component (named selection) END1
  2. Figures out how many nodes are attached to END1 (NMND)
  3. Takes ARG1 as the total load applied load
  4. Calculates the per node load by dividing the total load by the number of loads.
  5. Applies that per node load
  6. Reselects all the nodes

If I want to know how many nodes I put the load on and what the per node load is I’m kind of stuck here.  Any command object you add to the tree above the Solution branch only allows input parameters.

But a command snippet applied in the Solution branch is different, it allows you to pull parameters back and share them through the parameter manager.

When you first insert a command object you only get input parameters (ARG1-ARG9) as usual, and an empty section called “Results”

image

The way you get result parameters, or what I think should be called “Output Parameters” is you create a parameter in the command object’s APDL script that starts with “my_”  When you click outside the text input window the program parses you script and if it finds any “my_” parameters in the text, it sticks them in the Results section:

image

Note, the default is “my_” but you can change it n the “Output Search Prefix” line in the Definition block.

Initially they will show up pinkish because the model has not been run and they are not defined. Click on the box to make them parameters that get passed outside of the program and then run:

image

If you pop back out to the project view you will see that we now have a Parameter Set bar with both input and output parameters:

image

And if you open the parameter manager up you can see the input and output parameters:

image

This works because all ANSYS mechanical is doing is making one big batch input file for ANSYS MAPDL.  That file contains any command objects you insert into the tree and extracts any parameters that you tagged in a post processing command object for return to ANSYS Mechanical.

20 APDL Commands Every ANSYS Mechanical User Should Know

One of the most powerful things about ANSYS Mechanical is the fact that it creates an input file that is sent to ANSYS Mechanical APDL (MAPDL) to solve. This is awesome because you as a user have complete and full access to the huge breadth and depth available in the MAPDL program.  MAPDL is a good old-fashioned command driven program that takes in text commands one line at a time and executes them. So to access all those features, you just need to enter in the commands you want.

For many older users this is not a problem because we grew up using the text commands. But new users did not get the chance to be exposed to the power of APDL (ANSYS Parametric Design Language) so getting access to those advanced capabilities can be tough. 

In fact, I was in a room next to one of our support engineers while they were showing a customer how to change the elements that the solver would solve (Mechanical defaults to the most common formulation, but you can change them to whatever still makes sense) and the user had to admit he had never really used or even seen APDL commands before. 

So, as a way to get ANSYS Mechanical users out there started down the road of loving APDL commands, we got together and came up with a list of 20 APDL commands that every user should know.  Well, actually, it is more than 20 because we grouped some of them together.  We are not going to give too much detail on their usage, the APDL help is fantastic and it explains everything.  In fact, if you use a copy of PeDAL you can get the help right there live as you type (yes, that was a plug for you to go out and plop down $49 and buy PeDAL).

Also note that we are not getting in to how to script with APDL. It is a truly parametric command language in that you can replace most values in commands with parameters. It also has control logic, functions and other capabilities that you find in most scripting languages.  We will focus on actual commands you use to do things in the program here. If you want to learn more about how to program with APDL, you can purchase a copy of our “Introduction to the ANSYS Parametric Design Language” book. (another plug)

Some APDL Basics

APDL was developed back in the day of punch cards.  It was much easier to use than the other programs out there because the commands you entered didn’t have to be formatted in columns.  Instead arguments for commands are separated by commas.  Therefore, instead of defining a Node in your model as:

345   12.456    17.4567   0.0034 

(note that the location of that decimal point is critical). You create a line as:

N,345,12.456,17.4567, 0.0034

Trust me, that was a big deal. But what you need to know now is that all APDL commands start with a keyword and are followed by arguments. The arguments are explained in the Command Reference in the help.  So the entry for creating a node looks like this:

image

The documentation is very consistent and you will quickly get the hang of how to get what you need out of it.  The layout is explained in the help:  // Command Reference // 3. Command Dictionary

Another key thing to know about commands in MAPDL is that most entities you create (not loads and boundary conditions) have an ID number. You refer to entities by their ID number.  This is a key concept that gets lost if you grew up using GUI’s.  So if you want to make a coordinate system and use it, you define an ID for it and then refer to that ID. Same thing goes for element definitions (Element Types), material properties, etc…  Remember this, it hangs up a lot of newer users.

To use MAPDL commands you simply enter each command on a line in a command object that you place in your model tree. We did a seminar on this very subject about two years ago that you can watch here.

The idea of entity selection is fundamental to APDL.  Above we point out that all entities have an ID.  You can interact with each entity by specifying its ID.  But when you have a lot of them, like nodes and elements, it would be a pain.  So APDL deals with this by letting you select entities of a given type and making them “selected” or “unselected”  Then when you execute commands, instead of specifying an ID, you can specify “ALL” and all of the selected entities are used for that command.  Sometimes we refer to entities as being selected, and sometimes we refer to them as “active.”  The basic concept is that any entity in ANSYS Mechanical APDL can be one of two states: active/selected or inactive/unselected.  inactive/unselected entities are not used by whatever command you might be executing.

If you want to see all of the APDL command that ANSYS Mechanical writes out, simply select the setup branch of your model tree and choose Tools->Write Input File.  You can view it in a text editor, or even better, in PeDAL.

image

One last important note before we go through our list of commands: the old GUI for MAPDL can be used to modify or create models as well as ANSYS Mechanical. Every action you take in the old GUI is converted into a command and stored in the jobname.log file.  Many users will carry out the actions they want in an interactive session, then save the commands they need from the log file.

Wait, one more thing:  Right now you need these commands. But at every release more and more of the solver is exposed in ANSYS Mechanical FUI and we end up using less and less APDL scripts.  So before you write a script, make sure that ANSYS Mechanical can’t already do what you want.

The Commands

1. !

An exclamation point is a comment in APDL. Any characters to the right of one are ignored by the program. Use them often and add great comments to help you and others remember what the heck you were trying to do.

2. /PREP7 – /SOLU – /POST1 – FINISH

The MAPDL program consists of a collection of 10 processors (there were more, but they have been undocumented.) Commands only work in some processors, and most only in one.  If you enter in a preprocessor command when you are in the postprocessor, you will get an error.

When you create a command object in your ANSYS Mechanical model, it will be executed in either the Pre processor, the Solution processor, or in the Post processor.  Depending on where in the model tree you insert the command object.   If you need to go into another processor you can, you simply issue the proper command to change processors.  JUST REMEMBER TO GO BACK TO THE PROCESSOR YOU STARTED IN when you are done with your commands.

/PREP7 – goes to the pre processor. Use this to change elements, create things, or modify your mesh in any way.

/SOLU – goes to the solution processor.  Most of the time you will start there so you most often will use this command if you went into /PREP7 and need to get back. Modify loads, boundary conditions, and solver settings in this processor.

/POST1 – goes to the post processor. This is where you can play with your results, make your own plots, and do some very sophisticated post-processing.

FINISH – goes to the begin level. You will need to go there if you are going to play with file names.

3. TYPE – MAT – REAL – SECNUM

You only really need to know these commands if you will be making your own elements… but one of those things everyone should know because the assignment of element attributes is fundamental to the way APDL works…. so read on even if you don’t need to make your own elements.

Every element in your model is assigned properties that define the element.  When you define an element, instead of specifying all of its properties for each element, you create definitions and give them numbers, then assign the number to each element.  The simplest example are material properties. You define a set of material properties, give it a number, then assign that number to all the elements in your model that you want to solve with those properties.

But you do not specify the ID’s when you create the elements, that would be a pain. Instead, you make the ID for each property type “active” and every element you create will be assigned the active ID’s. 

The commands are self explanatory: Type sets the Element Type, MAT sets the material ID, REAL set the real constant number, and SECNUM sets the active section number. 

So, if  you do the following:

type,4
real,2
mat,34
secnum,112
e,1,2,3,4,11,12,13,14

you get:

     ELEM MAT TYP REL ESY SEC        NODES
      1  34   4   2   0 112      1     2     3     4    11    12    13    14
      2   3   4   4   0 200    101   102   103   104   111   112   113   114

4. ET

The MAPDL solver supports hundreds of elements.   ANSYS Mechanical picks the best element for whatever simulation you want to do from a general sense.  But that may not be the best for your model. In such cases, you can redefine the element definition that ANSYS Mechanical used.

Note: The new element must have the same topology. You can’t change a 4 noded shell into an 8 noded hex.  But if the node ordering is the same (the topology) then you can make that change using the ET command. 

5. EMODIF

If you define a real constant, element type, or material ID in APDL and you want to change a bunch of elements to those new ID’s, you use EMODIF.  This is the fastest way to change an elements definition.

6. MP – MPDATA – MPTEMP –TB – TBDATA – TBTEMP

Probably the most commonly needed APDL command for ANSYS Mechanical users are the  basic material property commands. Linear properties are defined with MP command for a polynomial vs. temperature or MPDATA and MPTEMP for a piece-wise linear temperature response.  Nonlinear material properties are defined with the TB, TBDATA, and TBTEMP commands.

It is always a good idea to stick your material definitions in a text file so you 1) have a record of what you used, and 2) can reuse the material model on other simulation jobs.

7. R – RMODIF

If you define an elements formulation with options on the ET command, and the material properties on the material commands, where do you specify other stuff like shell thickness, contact parameters, or hourglass stiffness?  You put them in real constants.  If you are new to the MAPDL solver the idea of Real constants is a bit hard to get used to. 

The official explanation is:

Data required for the calculation of the element matrices and load vectors, but which cannot be determined by other means, are input as real constants. Typical real constants include hourglass stiffness, contact parameters, stranded coil parameters, and plane thicknesses.

It really is a place to put stuff that has no other place.  R creates a real constant, and RMODIF can be used to change them.

8. NSEL – ESEL

As mentioned, selection logic is a huge part of how MAPDL works.  You never want to work on each object you want to view, change, load, etc… Instead you want to place entities of a given type into an “active” group and then operate on all “active” entities. (you can group them and give them names as well, see CM-CMSEL-CMDELE below to learn about components)

When accessing MAPDL from ANSYS Mechanical you are most often working with either nodes or elements.  NSEL and ESEL are used to manage what nodes and elements are active. These commands have a lot of options, so review the help.

9. NSLE – ESLN

You often select nodes and then need the elements attached to those nodes. Or you select elements and you need the nodes on those elements.  NSLE and ESLN do that.  NSLE selects all of the nodes on the currently active elements and ESLN does the opposite.

10. ALLSEL

A very common mistake for people writing little scripts in APDL for ANSYS Mechanical is they use selection logic to select things that they want to operate on, and then they don’t remember to reselect all the nodes and elements.  If you issue an NSEL and get say the nodes on the top of your part that you want to apply a load to. If you just stop there the solver will generate errors because those will be the only active nodes in the model. 

ALLSEL fixes this. It simply makes everything active. It is a good idea to just stick it at the end of your scripts if you do any selecting.

11. CM – CMSEL

If you use ANSYS Mechanical you should be very familiar with the concept of Named Selections. These are groups of entities (nodes, elements, surfaces, edges, vertices) that you have put into a group so you can scope based on them rather than selecting each time. In ANSYS MAPDL these are called components and commands that work with them start with CM.

Any named selection you create for geometry in ANSYS Mechanical gets turned into a nodal component – all of the nodes that touch the geometry in the Named Selection get thrown into the component. You can also create your own node or element Named Selections and those also get created as components in MAPDL. 

You can use CM to create your own components in your APDL scripts.  You give it a name and operate away.  You can also select components with the CMSEL command.

12. *GET

This is the single most awesomely useful command in APDL.  It is a way to interrogate your model to find out all sorts of useful information: number of nodes, largest Z value for node position, if a node is selected, loads on a node, result information, etc… 

Check out the help on the command. If you ever find yourself writing a script and going “if I only knew blah de blah blah about my model…” then you probably need to use *get.

13. CSYS – LOCAL – RSYS

Coordinate systems are very important in ANSYS Mechanical and ANSYS MAPDL.  In most cases you should create any coordinate systems you need in ANSYS Mechanical. They will be available to you in ANSYS MAPDL, but by default ANSYS Mechanical assigns a default ID. To use a coordinate system in MAPDL you should specify the coordinate system number in the details for a given coordinate system by changing “Coordinate System” from “Program Defined” to “Manual” and then specifying a number for “Coordinate System ID”

image

If you need to make a coordinate system in your APDL script, use the LOCAL command. 

When you want to use a coordinate system, use CSYS to make a given coordinate system active.

Note: Coordinate system 0 is the global Cartesian system. If you change the active coordinate system make sure you set it back to the global system with CSYS,0

RSYS is like CSYS but for results. If you want to plot or list result information in a coordinate system other than the global Cartesian, use RSYS to make the coordinate system you want active.

14: NROTATE

One thing to be very aware of is that each node in a model has a rotation associated with it. By default, the UX, UY, and UZ degrees of freedom are oriented with the global Cartesian coordinate system. In ANSYS Mechanical, when you specify a load or a boundary condition as normal or tangent to a surface, the program actually rotates all of those nodes so a degree of freedom is normal to that surface.

If you need to do that yourself because you want to apply a load or boundary condition in a certain direction besides the global Cartesian, use NROTATE.  You basically select the nodes you want to rotate, specify the active coordinate system with CSYS, then issue NROTATE,ALL to rotate them.

Be careful though. You don’t want to screw with any rotations that ANSYS Mechanical specified.

15. D

The most common boundary condition is displacement, even for temperature.  To specify those in an ANSYS MAPDL script, use the D command.  Most people use nodal selection or components to apply displacements to multiple nodes.

In its simplest form you apply a single value for displacement to one node in one degree of freedom.  But you can specify multiple nodes, multiple degrees of freedom, and more powerfully, the value for deflection can be a table. Learn about tables here.

16. F

The F command is the same as the D command, except it defines forces instead of displacement.  Know, it, use it.

17. SF – SFE

If you need to apply a pressure load, you use either SF to apply to nodes ore SFE to apply to elements. It works a lot like the D and F commands.

18. /OUTPUT

When the ANSYS MAPDL solver is solving away it writes bits and pieces of information to a file called jobename.out, where jobname is the name of your solver job.  Sometimes you may want to write out specific information, say list the stresses for all the currently selected nodes, to a file. use /OUTPUT,filename to redirect output to a file. When you are done specify /OUTPUT with no options and it will go back to the standard output.

19. /SHOW

ANSYS MAPDL has some very sophisticated plotting capabilities.  There are a ton of command and options used to setup and create a plot, but the most important is /SHOW,png.  This tells ANSYS MAPDL that all plots from now on will be written in PNG format to a file. Read all about how to use this command, and how to control your plots, here.

image

20. ETABLE

The ANSYS MAPDL solver solves for a lot of values. The more complex the element you are using, the more the number of values you can store.  But how do you get access to the more obscure ones? ETABLE.  Issue 38 of The Focus from 2005 goes in to some of the things you can do with ETABLE.

Where to go From Here

This is certainly not the definitive list.  Ask 20 ANSYS MAPDL users what APDL commands all ANSYS Mechanical users should know, and you might get five or six in common. But based on the support calls we get and the scripts we write, this 20 are the most common that we use.

Command help is your friend here.  Use it a lot.

The other thing you should do is open up ANSYS MAPDL interactively and play with these commands. See what happens when you execute them.

Direct Coupled-Field Elements in Mechanical APDL

We received one of those tech support calls last week that you hate getting.  It was something like “I need to transfer my ANSYS model to this other FEA package, how do I do that?”  We of course asked “Why do you need to go to this other package?” The answer was “Because they have elements that solve for stress and thermal degrees of freedom in the same element.”  Well, so does ANSYS Mechanical APDL, and it has for years.  But as a Workbench user they had only been exposed to Multiphysics that uses Load transfer as the mechanism to solve different domains in the same run

Therefore, a The Focus posting is born.

In this posting we will go over the basics of direct coupled-field elements and simulation to make everyone aware of what is available.

Direct Coupled-Field vs. Load Transfer

When most people talk about Multiphysics they are talking about Fluid-Structural Interaction (FSI) or some other interaction between two different models where the program solves each physics by itself and transfers the resulting values from one physics as a load on the next physics.  This is called load transfer Multiphysics and it is very useful and powerful.  But it requires a solve for each physics for each step in your solving process, and often more because you have to iterate back and forth between physics till things converge before you can move to the next substep.

There is a whole other way to do Multiphysics if you have the same mesh for each physics: you can modify your finite element equations to cover all the different physics in one set of equations, therefore in one matrix, and therefore in one pass through the solver for each solve.  This capability has been in the ANSYS Mechanical APDL solver for a very long time and has been expanded over time to cover some surprising combinations of physics.

So when should you use one over the other? That depends. Here are some thoughts:

  • Load Transfer Approach:
    • Your meshes need to be or are different
    • Fluid flow with something other then heat-transfer
  • Direct Approach:
    • The interaction between two physics is strongly coupled
    • The interaction is non-linear
    • Acoustics is involved
    • Piezoelectric is involved
    • Porous fluid flow is involved
    • Diffusion is involved

In general, if you can use Direct Coupling and you know MAPDL well, it is the preferred way to go, it is just a lot easier to do. But if you are not familiar with MAPDL for running and post processing, you may be better off with the Load Transfer approach.

The Coupled-Field Elements

You access the coupled-field capabilities in the solver through the use of the coupled-field elements.  Although there are some legacy elements that can be used as well, we will focus on the three standard coupled-field elements. They all have the same capability, and just vary in topology:

  • PLANE223: 2D 8 Node Quad
  • SOLID226: 3D 20 Node Hex
  • SOLID227: 3D 10 Node Tet

All of these support the following physics, DOF’s, forces and reaction loads:

Field DOF Label Force Label Reaction Solution
Structural UX, UY, UZ FX, FY, FZ Force
Thermal TEMP HEAT Heat Flow
Electric Conduction VOLT AMPS Electric Current
Electrostatic/Piezo VOLT CHRG Electric Charge
Diffusion CONC RATE Diffusion Flow Rate

You use a combination of KEYOPTS and material properties to enable the various types of coupling.  Take a look at the element documentation to see how it all works.

In addition to these, there are some specialty elements worth discussion. The first are FLUID29/FLUID30. These are the Acoustic field elements. These solve for displacement and pressure. They also can share the displacement DOF’s with structural elements where they touch.

Unfortunately the electromagnetic coupled field elements have been put on legacy status, as ANSYS Maxwell is where the development effort is going in this area. But you can still use them for coupled-field simulation that involves the MAG degree of freedom.  The elements are: PLANE13, SOLID5, SOLID98. ANSYS MAPDL still has actively supported electromagnetic elements, but they are electromagnetic only and do no support displacement or thermal degrees of freedom.

Flow in a fully saturated porous media can be modeled with the Coupled Pore-Pressure elements. These elements: CPT212/213/215/216/217, solve for pressure and deflection and are used for things like modeling nuclear waste issues, soil subsidence, oil well stability, and bone deformation and healing.

We should also mention that ANSYS supports circuit simulation using the CIRCU124 element.  This element can be coupled to other elements that have VOLT, CURR, or EMF capability.

image

Running Direct Coupled-Field Multiphysics in ANSYS Mechanical APDL

When I wrote this section heading it seemed like a good idea. But this is supposed to be a short blog entry and not a full one day training class. So I will wimp out and share where you can find more information in the help:

There is a whole manual dedicated to coupled-field analysis: Mechanical APDL // Coupled Field Analysis Guide. Within that guide is the Direct Coupled-Field Analysis section, Chapter 2.  In it you will not only find discussions about how to do what you need to do, but also a whole bunch of simple examples that are very helpful.

In general, you run like any other simulation.  There is really nothing special or unique and you do not have to deal with managing the load transfer like you do with load transfer coupled field simulations.

Running Direct Coupled-Field Multiphysics in ANSYS Mechanical

This is a question that comes up a lot. Unfortunately only one type of direct coupling is supported, Thermal-Electric.  What we recommend people do is they build their models in ANSYS mechanical for one of the physics, then use code snippets to change the elements to the proper direct coupled-field type and to also do any post processing. It will run when you solve, but it will come back with an error, and you need to post processes via APDL code or you need to post process in MAPDL interactively.

NEW INFO:  Edward points out in the comment below that you can get this to work.  I’ll repeat it here:

“We’ve had some success post-processing U-TEMP-VOLT analyses in Mechanical. Mechanical seems to accept a model as solved, so long as it sees a result file of the correct type in the Solver Files directory. The coupled field analysis in this case output a .rst file, so we used a Static Structural object as the base model. 
We could access the structural results directly and used User-defined results to access most of the thermal and electric results.
I seem to recall that we also had success using a Thermal analysis as a base and then changing the result file extension from .rst to .rth, but I can’t find my test model to confirm this.”

I can verify that both of these approaches work. I added a /sys, copy file.rst to file.rth to a code segment for the thermal base.  But it was simpler to just use the structural as the base.  If you do this you can do your post processing for the most part in ANSYS Mechanical. [E. Miller 3/28/2013)

Thoughts

So this was, as promised, a very high level overview. The fact of the matter is that there are a significant number of users, especially in the MEMS industry, that use these direct coupled-field elements all the time.  They are powerful and robust with as many uses as you can dream up, truly expanding the reach of what you can model and the accuracy of those models.

Over the years we have found some good tricks for using these elements effectively:

  1. Pick one of the physics and get a static run of that physics by itself running first. Debugging your model this way is usually faster and clears out any issues before you deal with the direct coupling issues. If you have more than two physics, add them in one at a time.
  2. Pay attention to units. When you start mixing voltage and distance or what not, it is easy to get confused. If you are doing MEMS devices, you need to make sure you are using the MEMS units and that you are consistent.  Unlike ANSYS Mechanical, ANSYS Mechanical APLD is unitless and requires the user to make sure the are consistent across physics.
  3. Try not to use the legacy elements if you don’t have to. They may not be around in the future.
  4. If you are doing EMAG, you may want to look at using load coupling with Maxwell or MAPDL instead of using the legacy direct coupled elements.  Maxwell and the newer elements in MAPDL have more capabilities and are more efficient.
  5. Make sure you really understand how your physics interact. Go through the thought experiment of predicting the interaction on as simple of a problem as you can, while keeping it relevant. Think about what loads interact with what structures and what that interaction implies.

Introduction to the ANSYS Parametric Design Language (APDL) Book Now Available on Amazon!

PADT-Intro-APDL-Amazon-PagePADT’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:
– Parameters
– 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.

PADT-Intro-APDL-cover

PADT-Intro-APDL-pg-020-021

  PADT-Intro-APDL-pg100-101

PADT-Intro-APDL-pg112-113

PADT-Intro-APDL-pg144-145

PADT-Intro-APDL-pg184-185

Legacy Training Material: Tcl/Tk for ANSYS Mechanical APDL

The Graphical User Interface (GUI) for ANSYS Mechanical APDL is written in a toolset called Tcl/Tk. This is actually the same GUI toolset that ICEM CFD uses.  Way back in the days when dinosaurs roamed the earth and the .com bubble was bursting, PADT wrote and Advanced Customization class for what was then just called ANSYS.  We still use a large portion of that class today, but one area that has really been mothballed is the chapter on Tcl/Tk.

But some users may find some value there so we present it here, in its un-edited and un-verified totality as a resource for the community.

ANSYS Mechanical APDL Tcl/TK Legacy Training

Use it with success, but at your own risk.

ANSYS-Tcl_Tk-Legacy-Training-2013_02_01

ICEM CFD as a Data Compliant System in ANSYS Workbench

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.

ICEM-CFD-System-ANSYS-Workbench

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.

image

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.

image

I then blocked it out:

image

And specified meshing sizes:

image

And generated the mesh:

image

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:

image

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:

image

Now when I go back to my project and check out the parameters for my ICEM CFD system I get:

image

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:

dp0_000

and here are the results. Exciting:

dp0_001

To try the whole thing out I made a design study:

image

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:

DesignPoints_ICEM-CFD-1

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:

  1. Update geometry if Tetin file changed
  2. Runs tetra default meshing, if no blocking file and no replay file
  3. If a replay file, run the replay file
  4. Runs Hexa default meshing if a Blocking file exists
  5. Convert any blocked mesh to unstructured mesh file
  6. Convert unstructured mesh file to solver input file
  7. 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.

Next Steps

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.

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.