Can ANSYS Mechanical Handle My Required Modeling Precision?

Sometimes you need to use ANSYS Mechanical to model a big part as a way to determine a very small deflection.  The most common situation where this happens is optics. A lens that is around a meter in diameter may have nanometer distortions from mechanical or thermal loads that impact the optics. A customer asked if ANSYS Mechanical can handle that.  Please find Alex’s interesting and in-depth response in the attached presentation.   There is theory that explains the situation, then an example of how to determine if you can get the information you need, followed by advice on how to view the results.

PADT-ANSYS-Mechanical-Modeling-Precision

 

Updates and Enhancements in ANSYS Mechanical 19.1 – Webinar

Don’t miss this informative presentation – Secure your spot today!
Register Here

If this is your first time registering for one of our Bright Talk webinars, simply click the link and fill out the attached form. We promise that the information you provide will only be shared with those promoting the event (PADT).

You will only have to do this once! For all future webinars, you can simply click the link, add the reminder to your calendar and you’re good to go!

10 Great New Features in ANSYS Mechanical 19.0 and 19.1

ANSYS Mechanical version 19.0 has been available since late January 2018, while version 19.1 was released in May. If you haven’t had a chance to check them out, we thought it would be helpful to list what we see as 10 of the top newest features. We’ll start with five new features from version 19.0 and will then round it out with five from version 19.1.

ANSYS Mechanical 19.0

1. 4 Cores HPC Solving with No Additional Licensing

Previously, you were limited to solving on 2 cores at a maximum without having additional ANSYS HPC or HPC Pack licenses. That limit has been raised to 4 cores at 19.0.
To utilize the cores while solving, from the Solution branch in Mechanical click on the Tools menu, then Solve Process Settings. Click the Advanced button. Set the Max number of utilized cores to 4 and click OK.

2. Topology Optimization Includes Inertial Loads

Topology optimization became a native option in ANSYS Mechanical in version 18.0. Topology optimization allows us to perform studies in which we preserve stiffness while reducing weight, for example. Since inertia loads are now supported in a topology optimization, one type of problem we can now solve is starting with geometry that has a mix of an inertial load (gravity in the downward direction) along with additional loading such as forces or pressures.

Solving the topology optimization and moving to the verification step we can see the optimization results (shape and contour results plot) for the combined loading.

The ability to include inertia loads adds quite a few more problems that can be considered for topology optimization.

3. Small Sliding Contact

The idea here is that if we have confidence that the contact and target elements within a contact region will not slide very much, we can turn on the small sliding assumption. This speeds up the computations because less checking is needed for the contact elements during the solution. It’s activated in the Details view for one or more contact regions. We’ve seen some marginal improvements in solution times for a couple of test models. It’s clearly worth trying this if it applies to your simulations.

4. Element Birth and Death

We now no longer have to use APDL command objects to incorporate element birth and death. If you’re not familiar with what this is, it’s the ability to selectively deactivate and/or activate portions of the finite element model to simulate forming operations, assembly, etc. Further, the implementation is fantastic in that unlike with the old MAPDL implementation, we no longer have to manually keep track of which elements have been ‘killed’ or made ‘alive’. The postprocessing in Mechanical 19.0 automatically displays only elements that are alive for a given results set.
Here is how it is implemented in the Mechanical tree, under the analysis type branch:

The entities to be killed or made alive can be selected by geometry or Named Selections. There is a handy table that shows the alive or dead status for each Element Birth and Death object once they are setup:

This animation shows a temperature results plot and demonstrates how the killed elements are made alive and automatically displayed when postprocessing:

5. Clipboard Tool

This new menu pick gives us an improved method for tasks such as selecting multiple faces. Rather than having to carefully pick all of them at once or use a combination of named selections, we can now simply select the faces that are easy to pick, add them to the clipboard, rotate the model, select more faces now that they are in view, etc.

Once all the desired faces are in the Clipboard, we simply use the Select Items in Clipboard dropdown and we can now assign a load or mesh control, etc. to the desired faces.

Note there are convenient hot keys for Adding to, Removing from, and Clearing the clipboard, shown in the screen captures of the menu dropdowns above.

ANSYS Mechanical 19.1

6. Granta Design Sample Materials

Version 19.1 adds a whole new set of sample materials from Granta. To access them, open up Engineering Data, click on the Engineering Data Sources button, and then click on the Granta Design Sample Materials button. This adds a lot more sample materials than have been available in Engineering Data previously.

7. Materials folder in Mechanical

You’ll see a new branch in the tree in Mechanical 19.1: Materials. All materials that are part of your Engineering Data set will show up in this branch. For each material defined, we can click on the Material Assignment button or right click as shown here:

One the new Assignment branch is created for a material, we can then select the bodies for which that material should be assigned. Each material has its own color which can be changed in Engineering Data if so desired.

Important note for Mechanical APDL command users: Assigning material properties using the Materials branch results in all parts with the same material property having the same MAPDL material number. This is different from prior behavior in Mechanical in which each part in the geometry tree had its own material number identified with the ‘magic’ parameter name matid. Parameter matid now no longer is unique for each part if materials area assigned using the Materials branch. There is a new ‘magic’ parameter named typeids which identifies the element type number for each part in the tree. This new parameter is actually a 1x1x1 array parameter rather than a scalar parameter, so to make use of it in a command snippet we need to add the dimension (1) to the parameter name, like this:

thtest1=typeids(1)

or

et,typeids(1),solid65

8. Result Tracking During Solution

A new, useful capability is to be able to view a result item on a body, while the solution is running. You can now insert certain results items under Solution Information and view the status of the results while the solution is progressing. If birth and death is employed it will even display just the elements that are alive as the solution progresses. Here is an example of a temperature plot on a body while a transient solution is in progress:

9. Save Animations to .wmv and .mp4 Formats

We now have two new options besides the old .avi format for exporting animation files. The .mp4 and .wmv formats both tend to produce smaller files than .avi format. When you click on the Export Video File button the new options are available in the dropdown:

10. Solution Statistics Page

Finally, there is a new Solution Statistics page, available under Solution Information when a solution has completed. This is a quick and easy way to view performance information from your solution and helps determine if more cores or more RAM could be beneficial in future solutions of the same model. Here is an example:

Conclusions

These are just a few of the enhancements that have been implemented in versions 19.0 and 19.1. These should help you be more productive with your solutions in ANSYS Mechanical as well as increase your capacity for simulating reality, and creating new geometry when it comes to topology optimization.

Extracting Relative Displacements in ANSYS Mechanical

A recurring theme in ANSYS Technical Support queries involves the separation of rigid-body from material deformations without performing an additional analysis. Many users simply assume this capability should exist as a simple post-processing query(or that in any case, this shouldn’t be a difficult operation). “Rigid-Body” displacements implies a transient dynamic analysis (as such displacements should not occur in static analyses), but as we’ll see, there are contexts within static structural environments where this concept DOES play an important engineering role. In static structural contexts, such rigid-body motion implies motion transmitted across multiple-bodies. There are two important and loosely related contexts we’ll look at; zero strain rotations of the CG and those rotations combined with strain-based displacement.

The following presentation explains the issues including the math behind it, offers solutions including useful APDL marcros, and then gives examples.

The models and macros used are in this zip file: PADT-ANSYS-Extract-Dsp-Files

PADT-ANSYS-Mechanical-Extracting-Relative-Displacements-20180404

You can also download the PDF here.

Find this interesting? This is just a small sample of PADT deep and practical understand of the entire ANSYS Suite of products.  Please consider us for your training, mentoring, and outsourced simulation services needs.

Save, Save, Save! Setting up a Save after Solution in ANSYS Mechanical

NOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!

Is this the reaction you have when you come in on Monday morning, and realize that another Windows update has, once again, rebooted your PC before you had a chance to save the 30-hour run that should have finished over the weekend? There a Workbench setting that can help relieve some of that stress.

The “Save Project After Solution” option will save the entire project as soon as the solution has finished. So when your model runs for 30 hours over the weekend, it gets saved before a Windows update shuts everything down.  These settings are persistent, so once you’ve changed them to ‘Yes’, then you are all set for next time. You just need to make sure that you change them for each ANSYS version if you have more than one installed.

Now on to my next blog… “How to recover a run if you forgot to change the settings above.” (Grumble Grumble!)

Estimating Structural Response to Random Vibration in ANSYS Mechanical: Reaction Forces

One of the key outputs from any random vibration analysis is determining the response of the object you are analyzing in terms of reaction forces.  In the presentation below. Alex Grishin shares the theory behind getting accurate forces and then how to do so in ANSYS Mechanical.

PADT-ANSYS-Random-Vib-Reaction-Forces-2017_11_22-1

As always, please contact PADT for your ANSYS simulation, training, and customization needs.

 

 

Using External Data in ANSYS Mechanical to Tabular Loads with Multiple Variables, Part 2

ANSYS Mechanical is great at applying tabular loads that vary with an independent variable. Say time or Z.  What if you want a tabular load that varies in multiple directions and time. In part one of this series, I covered who you can use the External Data tool to do just that. In this second part, I show how you can alternatively use APDL commands added to your ANSYS Mechanical model to define the tabular loading.

PADT-ANSYS-Tabular-loads-2

Working Wonders with ADPL Math Illustrated: Thermal Modal Analysis

Guest Blogger

We are pleased to publish this very useful post from Nicolas Jobert from Synchrotron SOLEIL in France. Nicolas is a Mechanical Engineer with more than 20 years of experience using ANSYS for engineering design and analysis in academia and industry. He currently is Senior Mechanical Engineer at Synchrotron SOLEIL, the French synchrotron radiation facility. He also teaches various courses on Design and Validation in the field of structural and optomechanics. He graduated from the Ecole Centrale Marseille, France, and is a EUSPEN member.

As Time Goes By

Do you remember the moment you first heard about ANSYS introducing APDL Math?

I, for one, do, and I have a vivid memory of thinking “Wow, that can be a powerful tool, I’m dead sure it won’t be long before an opportunity arises and I’ll start developing pretty useful procedures and tools”. Well, that was half a decade ago, and to my great shame, nothing quite like that has happened so far. Reasons for this are obvious and probably the same for most of us: lack of time and energy to learn yet another set of commands, fear of the ever present risk of developing procedures that are eventually rejected as nonstandard use of the software and therefore error-prone (those of you working under quality assurance, raise your hand!), anxiety of working directly under the hood on real projects with little means to double check your results, to name a few.

That said, finally an opportunity presented itself, and before I knew it, I was up and running with APDL Math. The objective of this article is to showcase some simple yet insightful applications and hopefully remove the prevention one can have regarding using these additional capabilities.

For the sake of demonstration, I will begin with a somewhat uncommon analysis tool that should nevertheless ring a bell for most of you, that is: modal analysis (and yes, the pun is intended). You may wonder what is the purpose of using APDL Math to perform a task that is a standard ANSYS capability since say revision 2.0, 40 years ago? But wait, did I mention that by modal analysis, I mean thermal modal Analysis?

Thermal Modal Analysis at a Glance

Although scarcely used, thermal modal analysis is both an analysis and a design validation tool, mostly used in the field of precision engineering and or optomechanics. Specifically, it can serve a number of purposes such as:

Q: Will my system settle fast enough to fulfill design requirements?
A: Compute the system Thermal Time Constants

Q: Where should I place sensors to get information rich / robust measurements?
A: Compute Thermal modes and place your sensors away for large thermal gradients

Q: Can I develop a reduced model to solve large transient thermal mechanical problems?
A: Modal basis allows for the construction of such reduced problem effectively converting a high-order coupled system to a low order, uncoupled set of equations.

Q: How to develop a reduced order state-space matrices representation of my thermal system (equivalent to SPMWRITE command)?
A: Modal analysis provides every result needed to build those matrices directly within ANSYS.

Although you might only be vaguely familiar with many or all of those topics, the idea behind this article is really to show that APDL Math does exactly what you need it to do: allow the user to efficiently address specific needs, with a minimal amount of additional work. Minimal? Let’s see what it looks like in reality, and you will soon enough be in a position to make your own opinion on the matter.

Thermal Modal Analysis using APDL Math

To begin with, it is worth underlining the similarities and differences between structural (vibration) modes and thermal modes.

Mathematically, both look very much the same, i.e. modes are solutions of the dynamics equation in the absence of forcing (external) term:

Domain

Equation solved

Terms Explained

Structural

[K] is the stiffness matrix
[M] is the mass matrix

Thermal

[K] is the conductivity matrix
[C] is the capacitance matrix

Now, the fundamental difference is that the eigenvalues have completely different physical interpretations (This is a direct consequence of the fact that dynamical systems are 2nd order systems, whereas thermal systems a 1st order systems. While after being disturbed the former will oscillate around equilibrium position, the latter will return to its initial state via exponential decay. Mind you, there is no such thing as thermal resonances!) :

  • Structural : λ=ω², i.e. the square of a circular frequency
  • Thermal: λ=1/τ, i.e. the inverse of time constant

No big deal, right? Hence, the APDL Math code for Thermal Modal Analysis should be a straightforward adaption of the original. As it turns out, the modifications are quite small. Below is a table comparing input codes to perform both type of analyses, using APDL Math.

 

Structural

Thermal

! Setup Model
 …

! Make ONE dummy transient solve 
! to write stiffness and mass
! matrices to .FULL file 
 /SOLU
 ANTYPE,TRANSIENT
 TIME,1
 WRFULL,1
 SOLVE


! Get Stiffness and Mass 
 *SMAT,MatK,D,IMPORT,FULL,,STIFF
 *SMAT,MatM,D,IMPORT,FULL,,MASS










! Eigenvalue Extraction
 Antype,MODAL
 modopt,Lanb,NRM,0,Fmax
 *EIGEN,MatK,MatM,,EiV,MatPhi

! No need to convert eigenvalues
! to frequencies, ANSYS does 
! it automatically



! Done !
! Setup Model
 …

! Make TWO dummy transient solve 
! to separately write conductivity
! and capacitances matrices to .FULL file
 /SOLU
 ANTYPE,TRANSIENT
 TIME,1
 NSUB,1,1,1
 TINTP,,,,1
 WRFULL,1

! Zero out capacitance terms
 …
 SOLVE
 ! Get Conductivity Matrice
 *SMAT,MatK,D,IMPORT,FULL, Jobname.full,STIFF
 ! Restore capacitance and zero out 
 ! conductivity terms
  …
 SOLVE
 ! Get Capacitance Matrice
 *SMAT,MatC,D,IMPORT,FULL,,STIFF

! Eigenvalue Extraction
 Antype,MODAL
 modopt,Lanb,NRM,,0,1/(2*PI*SQRT(Tmin))
 *EIGEN,MatK,MatC,,EiV,MatPhi

! Convert Eigenvalues for Frequency 
! to Thermal time Constants
!
 *do,i,1,EiV_rowDim
    Eiv(i)=1/(2*PI*Eiv(i))**2
 *enddo

! Done !

The only data requested from the users is the number of requested modes (NRM) as well as the upper frequency (or for that matter, the shortest time constant of interest). Also, note that in the thermal case, one needs to perform two separate dummy analyses to store the conductivity and capacitance matrices, since internally those are merged into an equivalent stiffness (conductivity) matrix:

If you are familiar with APDL, some important differences are apparent here:

  • Results from the eigenvalues are stored in a vector (EiV) and a matrix (MatPhi), which need not be declared but are created when executing the *EIGEN command (no *DIM required).
  • For each APDL Math entity, ANSYS automatically maintains variables named Param_rowDim and Param_colDim, hence removing the burden to keep track of dimensions.

But where on Earth is my eye candy?

Now that we have some procedure and results, we would like to be able to show this to the outside world (and to be honest, some graphical results would also help getting confidence in results).

The additional task to do so is really minimal. What we need to do is simply to put back those numerical results into the ANSYS database so that we can use all the conventional post-processing capabilities. This can be made using the appropriate POST1 commands, essentially: DNSOL. And, while we are at it, why not do a hardcopy to an image file? Here is the corresponding input.

 … User should place all nodes with non-prescribed temperatures in a component named MyNodeComponent

… First, convert Eigenvectors from solver to BCS ordering
 ! Conversion needed
 *SMAT,Nod2Bcs,D,IMPORT,FULL,Jobname.full,NOD2BCS
 *MULT,Nod2Bcs,TRAN,MatPhi,,MatPhi

! Then, read in mapping vector to convert to user ordering
 *VEC,MapForward,I,IMPORT,FULL,Jobname.full,FORWARD

! Put the results in ANSYS database
 /POST1
 *do,ind_mode,1,NRM
 cmsel,s,MyNodeComponent
 curr_node=0
 *do,i,1,ndinqr(0,13)
 curr_node=ndnext(curr_node)
 curr_temp=MatPhi(MapForward(curr_node),ind_mode)
 dnsol,curr_node,TEMP,,curr_temp
 *enddo
 Tau=1/(2*3.14*EiV(ind_mode))**2

To=NINT(Tau*10)/10 ! compress to 1 digit after comma
 /title,Mode #%ind_mode% - Tau=%To%s
 plnsol,temp
 ! Hardcopy to BMP file
 /image,SAVE,JobName_Mode%ind_mode%,bmp
 *enddo

This way, modes can be displayed, or even written to a conventional .RTH file (using RAPPND), and used as any regular ANSYS solver result.

Nice, but an actual example wouldn’t hurt, would it?

Now you may wonder what the results look like in reality. To remain within the field of precision engineering, let’s use a support structure typically designed for high-stability positioning. From a structural point of view, it must have a high dynamic stiffness and a low total mass so that a Delta shaped bracket is appropriate. Since we want the system to rapidly evacuate any heat load, we choose aluminum as candidate material. We do know from first principles that any applied disturbance will exponentially vanish and the system will go back to equilibrium state. Now, what will be the time constants of this decay?

For the sake of simplicity we restrict the analysis to a highly simplified, 2D model of such a support. PLANE55 elements are used to model the structural part while the heat sink is accounted for using SURF151. Boundary conditions are enforced using an extra node.

After applying boundary conditions, we execute the modal solution to obtain say – the first 8 modes.

Index Time Constant [s] Comment
1 535.9 Quasi-uniform temperature field (i.e. “rigid body” mode)
2 32.1 1st order (one wavelength along perimeter)
3 23.8 1st order (one wavelength along perimeter)
4 8.1 2nd order (two wavelengths  along perimeter)
5 6.8 2nd order (two wavelengths  along perimeter)
6 3.5 3rd order (three wavelengths  along perimeter)
7 3.1 3rd order (three wavelengths  along perimeter)
8 2.2 4th order (four wavelengths along perimeter)

The output is strictly the same as the one a standard modal analysis, except for the two additional lines at the end of the solving sequence.

Allocate a [8] Vector : EIV

Allocate a [227][8] Dense Matrix : MatPhi

Please note that the solution has 227 DOFs whereas the entire problem has 228 DOFs. This is the consequence of having introduced the boundary conditions as an enforced temperature on a node, which DOF is therefore removed from the DOF set to be obtained by the solver.

Also, we might want to use the modal shapes information to decide which locations are best suited to capture the entire temperature field on the structure. Without knowledge of the excitation source, one straightforward way to do so is to retain for each mode the node that has the largest amplitude. This is made even easier in this situation, since we have normalized each mode to have unit maximum amplitude we just need to select nodes having modal amplitude equal to 1 (or -1). On the figure below, each temperature sensor location is marked with a ‘TSm’ label where m is the mode index.

Doing so, we reach a pretty satisfactory distribution for the sensors locations, completely consistent with intuition. In numerical terms, we can also check that the modal matrix [Φ]_sensors, i.e. the original full matrix restricted to the selected DOF, has an excellent condition number. But there are many other things we could do starting from this. For example, with additional information, such as the location and the frequency content of the temperature fluctuations, one could further restrict the set of needed temperature sensors by running a dummy transient analysis and choosing locations where the correlation between sensors readings is as low as possible (using *MOPER,,,CORR). Even better, one can estimate the thermally induced displacements and select locations best suited to build an empirical model (typically using AR or ARMA), allowing one to predict structural displacements induced by temperature fluctuations using just a couple of sensors. This in turn can be used to select control strategies, check modal controllability… all within ANSYS.

Conclusion

APDL Math was presented as an alternate route for users who need to include specialized steps in an otherwise standard FE process, and in my opinion it does just that. The benefits can be immense and the learning curve is steep but short. As long as the user knows what he/she is doing, there is little possibility to get lost: after all, APDL Math only comprises 18 additional commands.

What hindered me so far was the necessity to account for internal, BCS and user ordering, but it really is not a big deal, as seen from the above example.

What is more, the possibility to store the created results in the Mechanical APDL database (DNSOL and RAPPND are your friends!) provides every means to control your results and finally to build confidence in your developments.

And for those of us who prefer to stay within Workbench environment, there is nothing preventing from including APDL Math procedures into Workbench command snippets.

This was just an introductory example, since many other applications could be found, to name a few just in the fields of precision engineering and/or opto-mechanics:

  • Speed up transient thermal mechanical analyses
  • Perform harmonic analysis of thermal models
  • Virtual testing of physical setup, including real-time control systems (model based)
  • Modal testing, error localization, automated model updating

Let us know your opinion on the matter, and if further introductory articles on APDL Math could be of use to the ANSYS users community.

Six Very Useful Enhancements in ANSYS Mechanical 18

By now you’ve probably heard that ANSYS versions 18.0, 18.1, and 18.2 have all been released in 2017. While 18.0 was the ‘point’ release in January, it should be noted that 18.1 and 18.2 are not ‘patches’ or service packs, but are full releases each with significant enhancements to the code. We’ll present some significant and useful enhancements for each.

18.0

Number 1: First and foremost – info on the new features is more readily accessible with the Mechanical Highlights list. The first time you launch Mechanical, you’ll see a hyperlinked list of new release highlights.

One you actually do something in Mechanical, though, that list goes away. There is a simple way to get it back: Click on the Project branch in the Mechanical tree, then click on the Worksheet button in the menu near the top of the window.
Clicking on the hyperlinks in the list or simply scrolling down gives us more information on each of the listed enhancements. Keep in mind the list is only highlights and by no means has all of the new features listed. A more detailed list can be found in the ANSYS Help, in the Release Notes.

Number 2: A major new feature that became available in 18.0 is Topology Optimization. We’ve written more about Topology Optimization here

Number 3: Another really useful enhancement in 18.0 is the ability to define a beam connection as a pretensioned bolt. This means we no longer need to have a geometry representation of a bolt if we want a simpler model. We can simply insert a beam connection between the two sides of the bolted geometry, and define the pretension on that resulting beam.
Beam connections are inserted in the Connections branch in Mechanical. Once the beam is fully defined, it can have a bolt pretension load applied to it, just like as if the beam geometry was defined as a solid or beam in your geometry tool. Here you can see a beam connection used for bolt pretension on the left, with a traditional geometric representation of a pretensioned bolt on the right:

18.1

Number 4: A very nice capability added in version 18.1 is drag and drop contact regions for contact sizing in the Mesh branch. Contact elements work best when the element sizes on both sizes of the interface are similar, especially for nonlinear contact. ANSYS Mechanical has had Contact Sizing available as a mesh control for a long time. Contact Sizing allows us to specify an element size or relevance level once, for both sides of one or more contact regions.

What’s new in 18.1 is the ability to drag and drop selected contacts from the Connections branch into the Mesh branch. Just select the desired contact regions with the mouse, then drag that selection into the Mesh branch. Then specify the desired mesh sizing controls for contact.
This is what the dragging and dropping looks like:

After dropping into the Mesh branch, we can specify the element size for the contact regions:

This shows the effect of the contact sizing specification on the mesh:

18.2

Number 5: An awesome new feature in 18.2 is element face selection, and what you can do with it. There is a new selection filter just for element face selection, shown here in the red box:


Once the element face select button is clicked, element faces can be individually selected, box selected, or paint selected simply by holding down the left mouse button and dragging. The green element faces on the near side have been selected this way:

The selected faces can then be converted to a Named Selection, or items such as results plots can be scoped to the face selection:

Number 6: Finally, to finish up, some new hotkeys were added in 18.2. Two really handy ones are:

  • Z = zoom fit or zoom to the current selection of entities
  • <Ctrl> K = activate element face selection
  • F11 = make the graphics window full screen!
  • Click F11 again to toggle back to normal size

Please realize that this list is just a tiny subset of the new features in ANSYS 18. We encourage you to try them out on your own, and investigate others that may be of benefit to you. Keep the Mechanical Highlights list from Number 1 in mind as a good source for info on new capabilities.

ANSYS ACT Console Snippets

So this is just a quick post to point out a handy feature in ANSYS Workbench, the ACT Console. There are times when you want some functionality in Mechanical that just is not yet there. In this example, a customer wanted the ability to get a text list of all the Named Selections in his model.  A quick Python script does just that.

import string,re

a=ExtAPI.DataModel.AnalysisList[0]  #Get the first Analysis if multiple are present 
workingdir=a.WorkingDir 
path=workingdir.split("\\\\") 

#Put the output file in the "user_files" directory for the project. 
userdir=string.join(path[:len(path)-4],"\\\\")+"\\\\user_files"  

#Use the name of the system in case the snippet is 
#used on multiple independent systems in the project. 
system_name=re.sub(" ","_",a.Name)  
model = ExtAPI.DataModel.Project.Model 
nsels = model.NamedSelections                  #Get the list of Named Selections 

if nsels:    #Do this if there are any Named Selections
     f=open("%s\\\\%s_named_selections_checked.txt"%(userdir,system_name), "w") 
     for child in nsels.Children:
        f.write("%s\n"%child.Name)
     f.close()

So to use a piece of Python code, like this, we use the ACT Console in Mechanical. To access the ACT Console in Mechanical 17.0, or later, just hit this icon in the toolbar.

The Console allows you to type, or paste, text directly into the black command line at the bottom.  But if we are going to reuse this code, then the use of Snippets is the way to go. In R17.0 they were called ‘Bookmarks’, but they worked the same way.

When you add a Snippet, a new window allows you to name the snippet and type in, or paste in, your code.

When you hit Apply, your named snippet is added to the list

From then on, to use the snippet you just click on it, and hit ‘Enter’. The text is basically, repasted into the command window, so you can set any variables needed prior to hitting your snippet.

The snippets are persistent and remain in the console, so they are available for all new projects. Using snippets is a great way to reduce time for repetitive tasks, without having to create a full blown ACT extension.

Happy coding!

Topological Optimization in ANSYS 18.1 – Motorcycle Component Example

We’ve discussed topological optimization in this space before, notably here:

If you’re not familiar with topological or topology optimization, a simple description is that we are using the physics of the problem combined with the finite element computational method to decide what the optimal shape is for a given design space and set of loads and constraints. Typically our goal is to maximize stiffness while reducing weight. We may also be trying to keep maximum stress below a certain value. Frequencies can come into play as well by linking a modal analysis to a topology optimization.

Why is topology optimization important? First, it produces shapes which may be more optimal than we could determine by engineering intuition coupled with trial and error. Second, with the rise of additive manufacturing, it is now much easier and more practical to produce the often complex and organic looking shapes which come out of a topological optimization.

ANSYS, Inc. has really upped the game when it comes to utilizing topology optimization. Starting with version 18.0, topo opt is built in functionality within ANSYS. If you already know ANSYS Mechanical, you already know the tool that’s used. The ANSYS capability uses the proven ANSYS solvers, including HPC capability for efficient solves. Another huge plus is the fact that SpaceClaim is linked right in to the process, allowing us to much more easily make the optimized mesh shape produced by a topological optimization into a more CAD representation set for use in validation simulations, 3D printing, or traditional manufacturing.

The intent of this blog is to show the current process in ANSYS version 18.1 using a simple example of an idealized motorcycle front fork bracket optimization. We don’t claim to be experts on motorcycle design, but we do want to showcase what the technology can do with a simple example. We start with a ‘blob’ or envelope for the geometry of our design space, then perform an optimization based on an assumed set of loads the system will experience. Next we convert the optimized mesh information into solid geometry using ANSYS SpaceClaim, and then perform a validation study on the optimized geometry.

Here we show our starting point – an idealized motorcycle fork with a fairly large blob of geometry. The intent is to let ANSYS come up with an optimal shape for the bracket connecting the two sides of the fork.

The first step of the simulation in this case is a traditional Static Structural simulation within ANSYS Workbench. The starting point for the geometry was ANSYS SpaceClaim, but the initial geometry could have come from any geometry source that ANSYS can read in, meaning most CAD systems as well as Parasolid, SAT, and STEP neutral file formats.
A single set of loads can be used, or multiple load cases can be defined. That’s what we did here, to simulate various sets of loads that the fork assembly might experience during optimization. All or a portion of the load cases can be utilized in the topological optimization, and weighting factors can be used on each set of loads if needed.
Here we see the workflow in the ANSYS Workbench Project Schematic:

Block A is the standard static structural analysis on the original, starting geometry. This includes all load cases needed to describe the operating environment. Block B is the actual topological optimization. Block C is a validation study, performed on the optimized geometry. This step is needed to ensure that the optimized shape still meets our design intent.

Within the topology optimization, we set our objective. He we choose minimizing compliance, which is a standard terminology in topology optimization and we can think of it as the inverse which is maximizing stiffness.

In the static structural analysis, 7 load cases were used to describe different loading situations on the motorcycle fork, and here all have been used in the optimization.
Further, we defined a response constraint, which in this example is to reduce mass (actually retain 15% of the mass):

Another quantity that’s often useful to specify is a minimum member constraint. That will keep the topology optimization from making regions that are too small to 3D print or otherwise manufacture. Here we have specified a minimum member size of 0.3 inches:

Since the topological optimization solution uses the same ANSYS solvers for the finite element solution as a normal solution, we can leverage high performance computing (distributed solvers, typically) to speed up the solution process. Multiple iterations are needed to converge on the topology optimization, so realize that the topo opt process is going to be more computationally expensive than a normal solution.

Once the optimization is complete, we can view the shape the topo opt method has obtained:

Notice that only a portion of the original model has been affected. ANSYS allows us to specify which regions of the model are to be considered for optimization, and which are to be excluded.

Now that we have a shape that looks promising, we still need to perform a validation step, in which we rerun our static simulation with the loads and constraints we expect the fork assembly to experience. To do that, we really want a ‘CAD’ model of the optimized shape. The images shown above show the mesh information that results from the topo opt solution. What we need to do next is leverage the ANSYS SpaceClaim geometry tool to create a solid model from the optimized shape.
A simple beauty in the ANSYS process is that with just a couple of clicks we proceed from Block B to Block C in the Workbench project schematic, and can then work with the optimized shape in SpaceClaim.

As you can see in the above image, SpaceClaim automatically has the original geometry as well as the new, optimized shape. We can do as much or as little to the optimized shape as we need, from smoothing and simplification to adding manufacturing features such as holes, bosses, etc. In this case we simply shrink wrapped it as-is.
Continuing with the validation step, the geometry from SpaceClaim automatically opens in the Mechanical window and we can then re-apply the needed loads and constraints and then solve to determine if the optimized shape truly meets our design objectives. If not, we can make some tweaks and run again.

The above image shows a result plot from the validation step. The geometry efficiently comes through SpaceClaim from the optimization step to the validation step. The needed tools are all nicely contained within ANSYS.

Hopefully this has given you an idea of what can be done with topology optimization in ANSYS as well as how it’s done. Again, if you already know ANSYS Mechanical, you already know the bulk of how to do this. If not, then perhaps what you have seen here will spark a craving to learn. We can’t wait to see what you create.

Secant or Instantaneous CTE? Understanding Thermal Expansion Modeling ANSYS Mechanical

One of the more common questions we get on thermal expansion simulations in tech support for ANSYS Mechanical and ANSYS Mechanical APDL revolve around how the Coefficient of Thermal Expansion, or CTE. This comes in to play if the CTE of the material you are modeling is set up to change with the temperature of that material.

This detailed presentation goes in to explaining what the differences are between the Secant and Instantaneous methods, how to convert between them, and dealing with extrapolating coeficients beyond temperatures for which you have data.

PADT-ANSYS-Secant_vs_Instantaneous_CTE-2017_07_05

You can download a PDF of the presentation here.

How-To: Connecting Shells Elements in Surface Models with ANSYS SpaceClaim and ANSYS Mechanical

By using the power of ANSYS SpaceClaim to quickly modify geometry, you can set up your surface models in ANSYS Mechanical to easily be connected.  Take a look in this How-To slide deck to see how easy it is to extend geometry and intersect surfaces.

PADT-ANSYS-Connecting-Shells-SpaceClaim-Mechanical

Coupling ANSYS Mechanical and Flownex

The below example demontrates how to couple Flownex and ANSYS mechanical using the Mechanical Generic Interface component.

For those that don’t know, Flownex is a thermal-fluid system modeling tool that is great for modeling heat, flow, pressure, etc… in systems.  At PADT we often connect it to ANSYS Mechanical to do more detailed component level simulation when needed. 

Why the need for the link in the fist place?

  • It is an automated workflow to couple Flownex and ANSYS through direct mapping of Flownex results (HTC and bulk temperatures) as boundary condition to an ANSYS thermal analysis.
  • Represents a conjugate heat transfer model with fluid calculations handled in Flownex
  • Allows one to easily/quickly investigate fluid flow and heat transfer properties under a wide range operating conditions.

First we will discuss the steady state thermal ANSYS Mechanical model that will be linked to Flownex.

We have a pipe Pipe with arbritraty geometry and material properties. Convection boundary conditions have been applied to both the internal and external pipe walls. The inernal Bulk Temperature will be supplied by Flownex.

  • External BC
    • HTC 100 w/m2K
    • Bulk Temperature 22C
  • Internal BC
    • HTC 1500 w/m2K
    • Bulk Temperature will be supplied by Flownex

A command snippet, which will calculate the total heat flow through the inner wall surface and write the value out into a text file called d_result, has been inlcuded in the ANSYS Mechanical model.

In order to achieve a bidirectional coupling, Flownex will execute the Mechanical APDL batch file. We can generate the Mechanical APDL batch file (ds.dat), from within Mechanical.

The soluiton procedure is as follows

  1. Flownex modifies the ds.dat file
  2. Flownex executes the modified ds.dat file
  3. The modified ds.dat file generates the d_result.txt file
  4. Flownex reads the d_result.txt file
  5. Flownex executes an iteration, using value from d_result.txt
  6. Repeat untill solutions are converged.

The next step after creating the ds.dat file is to set up your Flownex model.

The Flownex model comprises of a pipe component with arbritrary geomery, filled with air with an inlet temperature and pressure of 500˚C and 120 kPa respectilvy and a flow rate of approximatly 1kg/s.

We have connected the pipe component to the Mechanical Generic Interface using data transfer links.

The data transfer links pass the bulk fluid temperature form the pipe to the Mechanical Generic Interface component, and return the heat flow value calculated using ANSYS to the pipe.

Next we need place the ds.dat file in the AnsysMechanical_Files folder which is located in the Flownex project folder. It is necessary to create a copy of the ds.dat called ModifiedData.dat in the same location.

Let’s go over the inputs to the Mechanical Generic Interface component in Flownex:

1) Executable location

C:\Program Files\ANSYS Inc\v180\ansys\bin\winx64\Ansys180.exe

This is the path to ANSYS executable. Pay particular attention to the version number (eg 180, 172), as this will be different depending on the version of ANSYS you have installed.

2) Command line parameters

-b -i ModifiedData.dat -o results

Flownex will launch ANSYS, and execute the ModifiedData.dat Mechanical APDL batch file from the command line, using the above command a detailed description of command line options can be found in another blog post here.

3) Project files folder, Data file name and Modified data file name

Here we specify location of the Mechanical APDL batch files

4) Inputs

Here we will define where in ModifiedData.dat the value from Flownex, fluid temperature in this case, will be placed. This is done by determining what the boundary condition variable and ID is, and finding the prefix before the boundary condition value in the ds.dat file. Typically the variable for temperature is _loadvari and for HTC it is _convari.

It is possible to know the boundary condition ID by activating the appearance of Beta options in WB.

5) Outputs

Here we will specify the location of the d_result.txt that ANSYS generates. It should appear in the same folder as the Mechanical APDL batch files after successful execution.

Flownex and ANSYS will pass data back and forth every time step of a transient Flownex run.

The simulation should continue to run up to, and beyond the point where the Flownex and ANSYS simulation have converged. If we plot out the heat input or temperature value vs time we should be able to visualize convergence, akin to residual plots when running a CFD simulation, and then manually stop the simulation after values have stabilized.

Below we increase the fluid inlet temperature form 500˚C to 1000˚C after 10 iterations, and observed a increase in heat flow from ~1.4kW to ~2.8kW.

ANSYS 18 Mechanical Ease of Use Webinar – Coming Soon

We here at PADT are proud to present the ease of use and productivity enhancements that have been added to ANSYS Mechanical in release 18.

With this new release, ANSYS Mechanical focuses on the introduction of a variety of improvements that help save the users time, such as smarter data organization and new hotkeys, along with additions that can help you to better visualize specific intricacies in your models.

This webinar is coming up soon

Join PADT’s Simulation Support & Application Engineer Doug Oatis for an overview of the current user friendly interfaces within ANSYS Mechanical, along with the numerous additions in this new release that help to improve efficiency tenfold, such as:

Pretension Beam Connection

A beam connection is a power idealization to connect parts without modeling the bolts. Now the beam connection can be pretensioned as well.

Register today to find out how you can use this highly requested feature and many others to improve your throughput and stay ahead of the curve!