6 – An update on outputting results in Ansys Mechanical: 3D Printing Results

To support some new marketing efforts I had to make some different types of results output from models in Ansys Mechanical:

  • A 3D plot on a webpage
    Post 5
  • A physical printout on our 3D Printer
    Post 6

All of the posts are here.

This post is the final, of six, and we finally get to the topic that we get the most questions on: “How do I convert my Ansys Results to a 3D Printed Model.” This article will cover taking Ansys Mechanical FEA results, stress, vibration, and heat transfer, and make a cool 3D plot on Stratasys full-color printers. The process should work on other color printers, but we have only tested it with Stratasys.

3D Printing and Color

Since the beginning of 3D Printing, we have been using a file format called STL. The format only contains the external surface of an object represented as triangles, and it does not support color. But there is good news, a new format, 3MF, or 3D Manufacturing Format was recently introduced to replace STL. It is one of several 3D formats that contain not only triangles on the surface of an object, but they support color information for each triangle. 3MF is for 3D Printing. PLY, OBJ, X3D, and others are for rendering and viewing.

But there is bad news. At this time (2020 R2), no Ansys products support 3MF. So we need to get our results into a format that Stratasys can read color data from, which is the latest version of OBJ. Because of this, we will use our favorite Ansys post-processor, EnSight, to create a PLY file, then an open-source 3rd Party tool, Meshlab, to make an OBJ.

Note 1: As soon as Ansys supports 3MF or OBJ or someone adds a 3MF/OBJ ACT Extension, we will update this article.

Note 2: The steps below are actually covered in the post in Post 2 on how to use EnSight and Post 5 on how to make usable 3D result files. But I’ll repeat them here since you may have only come to learn how to make a 3D result file.

Step 1: Get what you want to print as PLY in Ansys EnSight

Ansys Ensight is a powerful tool that does so much more than make 3D result files. But we will focus on this particular capability because we can use it to get our 3D Printed results.

In Post 2 of this series, I go over how to get a high-quality 2D image from EnSight. Review it if you want more details or if you run into problems following these steps.

Before we get going, one key thing you should know is that Ansys EnSight reads a ton of formats, and one of them is the result files from Ansys Mechanical APDL. So we will start with getting that file.

The program reads Ansys Mechanical APDL result files. These are created when you run Ansys Mechanical and are stored in your project directory under dp0/SYS/MECH and is called file.rst or file.rth. I like to copy the result file from that directory to a folder where I’m going to store my plots and also rename it so I know what it is. For our impeller model, I called it impeller-thin-modal-1.rst.

Once you have your rst file, go ahead and launch EnSight.

That brings up a blank sessions. To get started click File > Open

This will bring up a dialog box for specifying a results file. If you click on the “File type:” dropdown, you will see the long list of supported files it can work with. Take a look while you are there and see if any other tools you use are listed. Of course, Ansys FLUENT and CFX are in there.

But the one we want is Ansys Results (*.rst *.rth *.rfl *.rmg). Chose that, then go to the directory where you put your Ansys result file.

EnSight will read the file and put it in a Case. It will list the results as Part 0 under Case 1.

The left part of the screen shows what you have to work with, and the right shows your model. The “Time” control, circled in green, is where you specify what time, substep, or mode you want. The “Parts” control lets you deal with parts, which we really won’t use. And the “Variables” control, circled in orange, is how you specify what result you want to view.

We want to plot deflection, which is a vector. Click on the + sign next to Vectors, and you get a list of what values you can show. The only supported result for model analysis is Displacment__Vibration_mode. Click on that. Then hold down the right mouse button and select “Color Part” > All.

This tells the program to use that result to shade the part. You should now see your contour.

Our example is a modal result. If you use a structural result file, you will be able to plot the displacement vector, as well as many stress results, under “Scalars”

By default, EnSight shows an undeformed object. If you want to see the deflected shape, click on the part then on the “Displacement” icon above the graphics window. Select the vector result you want to use, displacement in this case. Note, the default displacement factor may not be a good guess, change that till you get the amount of deflection you want.

Note, the default displacement factor may not be a good guess, change that till you get the amount of deflection you want.

The other thing you may want to change is the contours. It has a full library of colors you can change to, but I like the default. What I don’t like is that the min and max may not be where I want them, especially for modal deflection results. The min and max values are the min and max in the result file, and unless you normalize your results, you should tweak the values for your 3D print.

Here is the default color scheme for my 40th mode:

To change the range, click on the contour key and Right-Mouse-Button on the legend, and select Edit… This brings up the Create/edit annotation (legends) dialog. Then click “Edit Pallet…” at the top of that dialog to get to the Pallete editor.

You can make lots of changes here, but what I recommend you do is only change the min and max values. If I set the max to 50, I get this contour on my result:

Next, we wan to save as PLY.

Go to File > Export > Geomtric Entities.

In the dialog, chose PLY Polygonal File Format. This will be the generic format we can convert into something GrabCad likes. Make sure you specify which times or modes you want. By default, it will make a PLY for each one. Also, make sure you have selected the part.

Now you have a color-coded, faceted representation of your results, in a 3D file format. Just not one that GrabCADPrint currently supports.

Step 2: Convert to OBJ in MeshLab

Now we need MeshLab. There are many other tools the read PLY files and output to other formats, but MeshLab has not let me down yet. It is opensource, does everything, and is a pain to use. You will laugh at the user interface. But as ugly as it is, it works. You can download MeshLab from www.meshlab.net. Once you have it installed, follow these steps:

  • Open MeshLab
  • Chose File > Import Mesh
  • Spin it around, look at it. You could scale and transform. But we just want to convert it.
  • Chose File > Export Mesh As
  • Scroll down in the File of Type dropdown and pick Alias Wavefront Object (*.obj)
  • Save
  • Make sure you have only Color checked for Vert. Then click OK

Here is an OBJ file from the example above.

That is it. Import that file into Stratasys GrabCAD Print and have at it.

I printed a different mode shape, but I think it looks fantastic. Click to get the full-resolution version.

Closing thoughts

And this ends our series on getting output from Ansys Mechanical, circa early 2021. It was just going to be one article on getting higher resolution images, but it grew a bit. We hope you find it useful.

Remember, PADT is here to help. We are proud to be an Ansys Elite Channel Partner offering Ansys products across the southwestern US.

PADT has been doing this for a while, and we can offer help in terms of one-on-one support, training, customization, and consulting services. Although this article focused on Ansys Mechanical, we cover the physics across the Ansys product line with experienced engineers in every area. And don’t forget we do 3D Printing as a service as well as product design.

Please contact us to learn more.

5 – An update on outputting results in Ansys Mechanical: 3D Result Objects

To support some new marketing efforts I had to make some different types of results output from models in Ansys Mechanical:

  • A 3D plot on a webpage
    Post 5
  • A physical printout on our 3D Printer
    Post 6

All of the posts are here.

This post is the fifth of six and it is about creating results objects that can be viewed in 3D by people who don’t own Ansys Mechanical. You can use the Ansys Viewer, 3D PDF, make rendering files, and display on a web page. Using the Ansys viewer is simple and 3D PDF requires a plugin. For rendering or web viewing, it is not a direct shot, but with the help of EnSight and a few open-source tools, you can share complex 3D results with a lot of people.

Using the Ansys Viewer format and Ansys Viewer

Ansys solves the problem of sharing 3D results across their product line with people who don’t have Ansys through the Ansys Viewer. It is free, simple to use, and should be used in most situations. Right now you can export results from Ansys CFX, CFD-Post (for CFX or Fluent results), TurboGrid, and Ansys Mechanical to this format.

You can download the viewer here.

Making the file is very simple. Just Right-Mouse-Button on the object you want to share. Then select Export > Ansys Result Viewer

Then open this file in Ansys viewer and view away. We have not had any problems with customers of all skill levels use this tool.

For most real engineering situations, you should stop here. This is a robust way to share 3D result objects with anyone, and they don’t need a license of Ansys. But if you need more, including higher-quality 3D objects, keep going.

What about 3D PDF?

If you want to use 3D PDF, there is a plugin for this on the Ansys app store. One of the European channel partners, 7tech, has created More-PDF. Note, it is not free. Free to download and try, but there is a cost. It works in Ansys Mechanical as a plugin and has a stand-alone version that works with CFD Pre/Post, Electronics Desktop, or MAPDL. I won’t get into how to install or use it because the help files that come with are outstanding.

Here is a sample Ansys result that they have provided. You can view it in Acrobat Reader.

If you want to share results in PDF, this seems to be a good tool for that. I’m not sure what the pricing is for it. More information is here, including more example files.

Making a Generic 3D File: PLY

If you read the article on making high-quality images, you saw that Ansys Ensight is a very powerful tool. One thing it does is support a bunch of different 3D file formats. One of those formats is a PLY file, which is a great intermediate format for so much more.

Get started by following the instructions in the previous article about high-quality images using EnSight. But instead of exporting to an image, we are going to save as PLY.

When you have the result you want, go to File > Export > Geomtric Entities.

In the dialog, chose PLY Polygonal File Format. This will be our generic format we can convert into many different things (including 3D printer files, discussed in the next article.) Make sure you specify which times or modes you want. By default, it will make a PLY for each one.

You can now take that PLY file into any fancy rendering program. If you want to show your results in the middle of a rendered scene of something else, the PLY file is the file to use.

I downloaded the opensource tool Blender and gave it a try. The user interface in these tools is nothing like CAD or CAE tools, so it took me a while to get something useful. I think Keyshot Pro would be a better tool for those who don’t know “artist” tools like Blender.

If you do want to give it a try, you can get your color contours by clicking on the object after you import it, then click on the material icon and choose Surface, then set Surface to Specular, Base Color to Vertex Color | Color, and make sure the specular color is dark or black.

One could spend hours (days) learning a rendering tool and playing with surface reflection and transparency. But if you need something high quality for the marketing team, pass them a PLY file and let their graphic artists do their thing.

Here is the file to help if you do want to dig in yourself.

3D Web Results with X3D (and what happened to VRML?)

Early in the days of the web, there were a lot of people that saw the platform as a way to share and interact with three-dimensional virtual space. They create the Virtual Reality Modeling Language, VRML, as a way to represent 3D objects using triangles with detailed information on each triangle about color, texture, transparency, and shininess. It is fundamentally a file format that represents what your graphics card needs to do 3D graphics but in a common format. The fact that simulation results are basically the same thing made it a nice fit for sharing results, geometry, and meshes with other people.

It was pretty cool and you can still save Ansys information in VRML from various programs. But the viewers were clunky and were focused on the virtual reality experience and not showing 3D objects. It also never really took off because you needed a VRML viewer to see the object. That was always a pain.

As it drifted out of favor, an organization replaced it with a new, better format and a JavaScript viewer that would get loaded automatically: the result, X3D graphics.

Here is the result. Click on the impeller and spin away. Here are some basic commands:

Spin: Left Mouse Button
Pan: Middle Mouse Button
Zoom: Scroll Wheel

Reset: r
Show all: a

Are you sure you want to do this?

Now that I’ve gotten you excited about doing this, let me scare you. This is not for the faint of heart. You need to use an Ansys Mechanical APDL result file in Ansys Ensight to make the file. Then you need to do some HTML/CSS. If you are comfortable with going down that path, read on.

The obvious question is, “when will Ansys add these file formates to the Export capability?” Right now you can only export 3D results to a deformed STL (not color info) and the Ansys in-house Ansys Viewer Format, *.avz.

Getting an X3D from PLY

Now we need MeshLab. There are many other tools the read PLY files and output to other formats, but MeshLab has not let me down yet. It is opensource, does everything, and is a pain to use. You will laugh at the user interface. But if you want 3D objects on your website (or to 3D Print results) this is the best path. You can download MeshLab from www.meshlab.net. Once you have it installed, follow these steps:

  • Open MeshLab
  • Chose File > Import Mesh
  • Spin it around, look at it. You could scale and transform. But we just want to convert it.
  • Chose File > Export Mesh As
  • Scroll down in the File of Type dropdown and pick X3D File Format (*.x3d)
  • Save
  • Make sure you have onlly Color checked for Vert. Then click OK

Now we are really close… but not really. We have a X3D file.

Here are both the PLY and X3D files:

I hosted the x3d file on our web server as well.

Here is where the HTML/CSS happens. And explaining that is way beyond this post. Here is the code to show the solution of mode 35 of our impeller, as shown above:

<script src="https://x3dom.org/release/x3dom.js"></script>

<link rel="stylesheet" href="https://x3dom.org/release/x3dom.css" />
<style>
#imp1 {
    background: #000;
    border: 1px solid orange;
    margin-left: auto;
    margin-right: auto;
    width: 80%;
}
</style>
<x3d id="imp1" x="10px" y="10px" width="400px" height="400px" >
  <scene render="true">
    <environment id="myEnv" ssao="true" ssaoamount="0.5" 
	ssaoblurdepthtreshold="1.0" ssaoradius="0.4" 
	ssaorandomtexturesize="8" sorttrans="true" 
	gammacorrectiondefault="linear" tonemapping="none" 
	frustumculling="true" smallfeaturethreshold="1" 
	lowprioritythreshold="1" minframerate="1" 
	maxframerate="62.5" userdatafactor="-1" 
	smallfeaturefactor="-1" 
	occlusionvisibilityfactor="-1" 
	lowpriorityfactor="-1" 
	tessellationerrorfactor="-1">
    </environment>
    <SpotLight id='spot' on ="TRUE" beamWidth='0.9' 
	color='0 0 1' cutOffAngle='0.78' 
	location='0 0 12' radius='22' > 
    </SpotLight>
    <NavigationInfo id="head" headlight='true' type='"EXAMINE"'>      
    </NavigationInfo>
    <Transform translation = '0 0 -2'>
      <inline 
	url="https://www.padtinc.com/downloads/i1-m35-3d-a.x3d"> 
      </inline>
    </transform>
  </scene>
</x3d>

The above code works for our example and has a smattering of options available to make your image show the way you want it. There are hundreds more. If the code makes sense to you, use the documentation at x3dom.org to do more. If it looks like gobly-gook, find someone who can help you or buckle down and learn. It’s not hard, just different for us simulation types.

Some Tough Talk about 3D Results

The truth of the matter is that Ansys Mechanical is great for looking at 3D Results in Mechanical or in the Ansys Viewer. It is not set up to support other 3D file formats. And there is a reason for that. Do you really need to have a 3D PDF? Is having a 3D result on your website just cool, or do you really need it?

The fact is, for most projects, you need a 2D image of your key results in your report. Most of the fancy 3D viewable is to help people who don’t have Ansys understand results better. Or you need it for marketing. For the first case, just use the Ansys viewer. For the second, it can be a bit of work but you can create some eye-catching geometry.

However, one advantage of having a 3D result object is that you can convert it into something you can 3D print. And that is the subject of our next, and final post on this topic: “6 – An update on outputting results in Ansys Mechanical: 3D Printing Results.

4 – An update on outputting results in Ansys Mechanical: Animated GIFs

To support some new marketing efforts I had to make some different types of results output from models in Ansys Mechanical:

  • A 3D plot on a webpage
    Post 5
  • A physical printout on our 3D Printer
    Post 6

All of the posts are here.

This post is the fourth of six, and it is about making animation files that are not videos, called Animated GIFs (pronounced with a J like Jeff, not G like Garry).
For a couple of reasons, making an animated gif is not as easy as we would like, but with a few tips below, it is not so difficult.

Animated GIFs explained

The GIF image file, Graphics Interchange Format, was invented in 1987 when color computing was new and the internet was not around yet. It is compact and allows only 256 colors (remember that part) and supported animation. The animated format was very popular on dial-up services and the early internet. They then fell out of favor until their use in messaging apps and social media to send animations to people that did not require a player. Everyone could see your cat falling off the table, instantly.

Or their dog being woken up in the middle of an afternoon nap. I just took my iPhone, turned around in my chair, and took this video. Then I converted it to a GIF. It took me less than 30 seconds to make and share this gem:

For those of us in the world of simulation, they have been a popular format for the same reason—almost all applications, from email to web browsers to Microsoft Powerpoint, support animated GIFs. The file contains as many images as you want and a tag for each layer documenting how long to display each frame. The difference is we are not capturing our overweight mutt struggling to roll over. We have specific information we are trying to convey.

Ansys Mechanical Default

If you read the post about making videos, you will remember that one of the output options was GIF. Well, here is what you get when you use that option. Note, it only plays once, to play it again.

And by default, the file does not repeat. Also, to make things worse, the way Ansys stores the GIF is an order of magnitude larger than a video.

As a contrast, here is the same result as video played through YouTube

Video to GIF is much better

So, unless you need something in 30 seconds, don’t use the default save video as GIF in Ansys Mechanical. A much better option is to convert a good video to a GIF.

So, go back to the article on making videos and get what you want for your animation using that info and save it to *.mp4 format. Then use one of the methods below to convert that to GIF.

Ezgif.com

If I take the video above that I posted on YouTube and run it through the free conversion tool, ezgif.com, I get this:

It is not as nice as the video, but it does not need a player. It just plays. Ezgif.com is free (lots of advertising) but has a lot of options. Not only does it covert quickly, but it also lets you crop, resize, add effects, change the speed, add text, and overlay.

The downside, if you have proprietary information you are letting someone else see it. My guess is uploading to a free server in the cloud will violate any NDA or security you have in place. But if not, ezgif.com is the simplest way to get a GIF from a video.

Adobe PhotoShop

The first option, if you can’t use a free cloud-based tool like ezgif.com, is the Photoshop suite. Photoshop is the defacto tool for image editing and processing, and it has a lot of tools for making sophisticated animated GIFs, including importing a video, editing the frames from the video, and outputting a GIF.

Here is the process:

  1. Open Adobe Photoshop
  2. Chose File > Import > Vidio to Layers
  3. Chose your MP4 file
  4. In the “Import Video to Layers” dialog, make sure “From Beginning to End” is chosen and “Make Frame Animation” is checked on.
  5. Click OK
    1. At this point, you can do a huge amount of modifying and editing. But that is way beyond the scope of this post. We just want a GIF made. But if you know Adobe Photoshop, have at it. I often crop and change the size here. Maybe even run some filters on it. Or, if I’m getting really fancy, delete the background from each frame to have a transparent animation.
  6. Go to File > Export > Save for Web (Legacy)
  7. Chose GIF as the file format.
    1. Set colors to 256
    2. I like to set Dither to 100%
    3. Make sure Animation > Looping Options at the bottom is set to Forever.
    4. Click Save… and give it a file name.

Here is what the result looks like:

Adobe Premier

Adobe Premiere is, well, the premier tool for video editing and creation. Many professional videos are made with this tool. It is massive, powerful, and made for people who speak video. If you want to add to your animation, do fancy things with it, use Premiere. Otherwise, stick with Photoshop or an open-source or cloud tool.

But, if you want to use Premier, here is that basic process without any bells or whistles (literally and figuratively) added in:

  1. Open a new Project
  2. Specify a good directory for the project
  3. Drop your MP4into the Project Window
  4. The drag it to the Timeline
    1. Here is where you do your editing magic on the video.
  5. When you are ready to make your file, click File > Export > Media
  6. Chose Animated GIF for the format
    1. Do not pick GIF. That will make an image of every frame.
  7. Click on the name next to “Output Name” to set the name and directory.
  8. Make any other changes you feel are correct if you know Premier.
  9. Click Export

This is what you get.

GifTuna

if you don’t have access to any Adobe tools, I recommend GifTuna. Yes, the name is stupid. But it works and it is free.

Go to giftuna.io and download the app. it comes as a ZIP file. Just extract the zip file and run the executable, GifTuna.exe. It will then ask you to install FFMPEG. This is the same library that ezgif.com uses.

Once everything is installed:

  1. Click “Select File”
  2. Select the video you saved in Ansys Mechanical.
  3. Change the size if you want to
  4. Keep all the other defaults for your first pass.
  5. Click Export

You get a pretty nice video. Play with the dither options if it looks kind of fuzzy.

Making an Animated GIF out of Images

In all the examples above, we created animations by converting a good video into the animated GIF format. What if we just have a bunch of images and want to make a slide show out of them. Or maybe we want to show a series of geometry changes. Maybe the various steps in an animation.

In that case, save an image to a PNG or JPEG file for each frame you want, then use ezgif.com or PhotoShop to make your animation.

A word about APNG

The only real problem with Animated GIFS is that the GIF format only supports 256 colors. In many ways, PNG took over for GIF as the preferred file format. It is compact, handles transparency, and has the advantage of not being restricted on colors. The problem, only browsers support APNG. PowerPoint and most mail programs do not. And many tools like the Adobe Suite do not output in that format. But, ezgif.com does.

In fact, WordPress does not support the format. To view the APNG file, download this file and then open it in a browser:

Maybe someday this will be supported better. Hopefully in Microsoft products soon.

Moving from Motion to 3D

This should help you get a nice animation that you can put on a website and not have to worry about hosting so people can see it. The same goes for Email and PowerPoint. If you can live with fewer colors, it really is the best format for animations of results when you need to show them anywhere.

Now its time to move from 2D results to 3D. We will cover how to create 3D objects of your results in “5 – An update on outputting results in Ansys Mechanical: 3D Result Objects.

3 – An update on outputting results in Ansys Mechanical: Making Videos

To support some new marketing efforts I had to make some different types of results output from models in Ansys Mechanical:

  • A 3D plot on a webpage
    Post 5
  • A physical printout on our 3D Printer
    Post 6

All of the posts are here.

This post is the third of six and it is an update on making videos of results animations with Ansys Mechanical. A lot of improvements have been made in recent releases and you can get good quality videos that are very useful for sharing results with others.

Getting a video of what you see on the screen

In most cases, you can get the video you need by using the animation tools built into Ansys Mechanical. By default, the animation tool shows up at the top of the animation window. If it is not there, go to Home > Layout > Reset Layout. Or add it with Home > Layout > Manage > Graph.

The key thing to know about making videos of results in Ansys Mechanical is that the “save to file” commands do a screengrab of what you see on the screen. So the size, orientation, and resolution are what is in front of you.

The Export Video File button is how you save the animation to a file.

As the tip in the image shows, the command supports AVI, MP4, WMV, and GIF formats. We will discuss the formats below and improving quality in the next section. Most of the time, you should pick MP4 and save the file.

But first, you should know that there are four things you can animate and save to a video file: modal results, static results, results over time, and motion of the camera (keyframe).

Plotting Mode Shapes

Modal results are the simplest. In our example impeller, you need to pick the mode you want to view, get the orientation you want, and then click the play button. When you are ready to make your video file, click the”Export Video File” button and save it.

Now is a good time to explore the different formats. For the sample model I’m using, the file size for the three video formats is pretty much the same:

MP41,139 KB
WMV1,320 KB
AVI1,120 KB
GIF29,072 KB

The Animated GIF is much larger, and it turns out, a much lower quality format. We will cover that in the next article, let’s just ignore GIF for now.

Taking a look at the 3 videos, I’m not sure I can tell a difference. Note, you need to download them and play them on your desktop to see any differences. If we upload to a streaming service then the format gets changed by the service.

And here it is embedded as a YouTube Video, which we will do for all the other examples. I used the MP4 format because I think it might look a little better.

Static Results

This one is very simple and is identical to mode shapes. It plots one result from initial conditions to the final result. Although in our example, it’s not so useful, for complex bending with lots of different loads, it can be handy.

Results Over Time/Steps

The most common use for animation is looking at results over time or over multiple load steps. I was too lazy to build a transient example, so I just put some strange acceleration loads on our impeller and varied them over 5 timesteps.

This gave some movement of the rotor (we will cover changing deflection exaggeration in the next section) so you can see what is going on.

To get your animation, select the result you want from the tree and orient things in a way that shows what you need to show. Push play to view. Tweak as needed then save as we did with modal results. This is what you get:

With the default settings, it creates the specified number of frames across the whole result set. This uses the “Distributed” setting, the green icon. If you watch the vertical line as it animates, you can see it linearly interpolating results between result steps.

If you don’t want this, then click the blue icon to get one frame per solution on the result file. This is a good idea, and even critical, for many transient runs or nonlinear runs where linear interpolation is not correct. Notice how the field for specifying frames is grayed out and set to 5. That is because we have 5 result sets.

To show the difference, including the graph at the bottom, I actually did a screen recording, which we will cover in the last section.

It really is simple. Get what you want going on your screen, then save it to a file.

Making it better

The default settings are great for most situations, but you can get better results with a few small changes.

Distortion

For any type of mechanical simulation, you are solving for deflection, and you usually want the distorted shape to show up in your animation. Most of the time the program calculated exaggeration is just fine. But if you need to change it, use Result > Display and the drop-down for the Deformation Scale Factor. Change it and see what happens.

Background

The first thing I always do is get rid of the blue gradient background. One reason for this is that the compression algorithms that various video formats use can cause the background gradient to shift slightly over the video. Or it might reduce the colors. Having a solid background gets rid of that. And, if you ask me, it just looks better.

You can set your preferences for images to always have a white background, but you can’t do that in Animation. So you need to change the Workbench background.

Go to Workbench > Tools> Options…

Then select Appearance. Set Background Style to Uniform and the first color to the color you want. I use White.

But a rich purple is kind of cool and makes the other colors stand out:

Remember to change this back when you are done making your animations. If you are working debugging a really tricky model, that purple will burn a hole in your head.

Size

Remember, Mechanical is just doing a screen capture in the background, so the size of your plot on your computer screen determines the output. Sometimes you may want a small video, sometimes a big one. Let’s look at getting the highest resolution possible.

The graphics window size is determined by everything around it. By default, the graphics window is embedded, but with a little trick, you can set it free.

Here is the default on my monitor, my rotor is 584 pixels tall. (my screen is 1080 pixels high.

  1. Go into full-screen mode by pressing F11 or clicking Home > Layout > Full Screen
  2. Then click the X Tabular data windows to remove it.
  3. Grab the blue strip on the Graph window and drag it to pull it out of the window. You need to keep that window to save your animation.
  4. Press CTRL-O to get rid of the outline
  5. Press CTRL-D to remove the details window.

That gives you a nice big window of your results. Now my impeller is 911 pixels tall. And I can zoom in a little to get it a bit bigger.

But you will notice the screen is wide. If I animate now, for my geometry, I’m wasting a lot of bits storing the background. Click on the “Restore Down” button in the upper right of your window to get it out of windows full screen. Then drag the edges to get the size and shape that are just big enough to show your results.

If you want another 20 pixels (now we are getting greedy) you can get rid of the toolbar at the top. Click on the tiny down arrow on the far right of the toolbar. Then click Add or Remove Buttons > Customize. Then uncheck “Graphics.”

Now run your animation. Then, when you are happy, save it. You can bring the outline back with CTRL+O if you need it. If you need more pixels, get a higher resolution monitor or stretch the graphics window over multiple monitors.

I’m working on a Microsoft Surface, and I’ve been doing my animations on my portable monitor, which is only 1080 pixels high. To get the best image, I moved over to the main screen, which is 1824 high.

So with all the tricks and on my highest resolution monitor, I get a video that is 1785 pixels high, and it looks pretty good, even after YouTube compresses it:

Here is the file to view on your own machine:

Important! To get back hit F11 then Home > Layout > Reset Layout. You may have to also do Home > Layout > Manage > Tabular Data to get that window back and Home > Layout > Manage > Graphics Toolbar to add that back to the top of the graphics window

Frames & Time

The last thing to play with is the number of frames and the length. A good rule of thumb is to not have less than 10 frames per second. And greater than 20 is good. Set it to 5 Frames and 5 Seconds to see blocky. Then 100 Frames and 5 Seconds (20 frames/sec) to see everything smooth.

Moving the object with Keyframe animation

If you want the object to move during an animation, you can use what is called Keyframe animation. To be honest, I am not sure I’m using it right in the program, but I got it to work somewhat, so I’ll share what I did. I’m also only going to cover the basics, see the documentation for more.

First, open the Keyframe Animation tool with Home > Tools > Keyframe Animation.

Orient your parts the way you want them, and click the add Keyframe button. The one with the green plus.

Now pick your second orientation, and add it to the list. Keep going till you have all your orientations in there. Set the time to somehting like 4 or 5 seconds, and hit play.

Now, getting a little fancy, you can add pauses at any Keyframe if you want. Do this by double-clickingon the Keyframe step to orient the part, then click the Insert Keyframe icon (top row, 4th from the left) to make a copy. You now how two keyframes at the same orientation so your part won’t move.

This window has a save animation button as well, so save it. When I used it, this is what I got:

This spins the final distorted shape, not the animated shape.

If you look at results that are not from a modal run, you will see that you can animate the results over time by clicking on the Keyframe icon in the animation bar:

The first icon, red circle, tells the program to change the orientation as defined in the Keyframe Animation Window while it animates your results. Click on the second icon, green circle, to use the frame counts you have specified in your Keyframe Animation Window.

This is what the multi-step results look like over the motion:

What about modal? Well in theory you can’t plot a mode shape with keyframe animation. But… if you set up a keyframe for a non-modal result, run it. Then move to a modal result, it works, sort of. The results animate if you have two keyframes that are the same next to each other. This is not a documented feature and may even be a bug. But here is how it looks:

When all else fails, make your own recording

Sometimes you can’t get what you need saved to a file, but you can see it on the screen. Including the Graph window is a good example. Rotating a modal result, since Keyframe really doesn’t work with modal, is another good example. Now that we all have learned to use online meeting software through COVID-19, we know how to do a screen capture of the animation. I use MS Teams and it works just fine.

But, the quality is OK and you get artifacts from the meeting, like my icon on the bottom for attendees. Those can be edited out, but not ideal. Here is a sample:

If you need better quality, a dedicated screen capture program may be better.

And it turns out that Windows 10 had a built-in screen recorder. It’s called XBOX Game Bar, and it works pretty well. Here is a link on how to use it.

And I get a nice full screen video:

Play, but not too much, and RTM.

The last bit of advice we can give on animating in Ansys Mechanical is that if you want something beyond the defaults, set aside some time to play. There are a lot of options, many we have not even looked at. But at the same time, in your quest for an Oscar, you may be spending time on something that is not going to make a difference. So use your time wisely.

And as always, Read the Manual. There is a wealth of detailed information there.

Getting the right Animated GIF

Now that we have covered creating various video formats, what about making an animation that doesn’t need some sort of player? The next post, “4 – An update on outputting results in Ansys Mechanical: Animated GIFs” explains how to do that.

2 – An update on outputting results in Ansys Mechanical: Taking it to the Next Level with Ansys EnSight

To support some new marketing efforts I had to make some different types of results output from models in Ansys Mechanical:

  • A 3D plot on a webpage
    Post 5
  • A physical printout on our 3D Printer
    Post 6

All of the posts are here.

This post is the second of six on what I’ve learned after fiddling around for a while. It is looking at a post-processing tool that Ansys acquired a few years back called Ansys EnSight. It takes making output to the next level in functionality and quality.

More options and ray tracing with Ansys EnSight

Back in 2017, 3 years ago, if you don’t account for COVID-19 time dilation, Ansys, Inc. acquired a company called Computational Engineering International. They had a product called EnSight, which was the best post-processing tool on the market. Many FLUENT, CFX, and LS-DYNA users would use EnSight to do advanced result interrogation and output. Its capabilities focus on doing complex visualization and automation. Along with real engineering tools and support for an extensive range of tools, it also makes really nice plots. For this post, we will focus on that part. This is an amazingly capable tool, and I’ll only cover the bare minimum that you need to know to get a result from Ansys Mechanical in and plotted. See the help or online training for more on this fantastic tool.

Ansys EnSight is its own stand-alone program. It can be licensed on its own or as part of various CFD bundles. If you are a larger company that does CFD, you probably have one or more seats.

The program reads Ansys Mechanical APDL result files. These are created when you run Ansys Mechanical and are stored in your project directory under dp0/SYS/MECH and is called file.rst or file.rth. I like to copy the result file from that directory to a folder where I’m going to store my plots and also rename it so I know what it is. For our impeller model, I called it impeller-thin-modal-1.rst.

Once you have your rst file, go ahead and launch EnSight.

Setting up images in Ansys Ensight

That brings up a blank sessions. To get started click File > Open

This will bring up a dialog box for specifying a results file. If you click on the “File type:” dropdown you will see the long list of supported files it can work with. Take a look while you are there and see if any other tools you use are listed. Of course, Ansys FLUENT and CFX are listed. This is first and foremost a CVD post-processor.

But the one we want is Ansys Results (*.rst *.rth *.rfl *.rmg). Chose that then go to the directory where you put your Ansys result file.

EnSight will read the file and put it in a Case. It will list the results as Part 0 under Case 1.

The left part of the screen shows what you have to work with, and the right shows your model. The “Time” control, circled in green, is where you specify what time, substep, or mode you want. The “Parts” control lets you deal with parts, which we really won’t use. And the “Variables” control, circled in orange, is how you specify what result you want to view.

We want to plot deflection, which is a vector. Click on the + sign next to Vectors, and you get a list of what values you can show. The only supported result for model analysis is Displacement__Vibration_mode. Click on that. Then hold down the right mouse button and select “Color Part” > All.

This tells the program to use that result to shade the part. You should now see your contour.

Our example is a modal result. If you use a structural result file, you will be able to plot the displacement vector, as well as many stress results under “Scalars”

Next, you will want to clean things up. Go to View and turn things on and off as you see fit. I like to turn off perspective, the Axis triad, and sometimes the legend.

You may notice the “Lighting…” option. If you really want to get fancy, you can specify various lights to get shadows and such. I like to add a spotlight above and slightly off-center from the part. You can waste a lot of time playing with lights, so try to avoid it if you can.

To pick which mode or timestep you want, use the “Time” control. Clicking on the step forward or step back buttons (triangle with a small rectangle at the base) steps you through the results on your file. Or you can drag the slider.

By default, EnSight shows an undeformed object. If you want to see the deflected shape, click on the part then on the “Displacement” icon above the graphics window. Select the vector result you want to use, displacement in this case.

Note, the default displacement factor may not be a good guess, change that till you get the amount of deflection you want.

These are only a few of the dozens of options available. But we can get most of what we need with these, so let’s look at saving the plot.

Saving your image

Now its time to get a rendered plot. Go to File > Export > Image

There is a lot to do in the “Save image” dialog. First, set the format (red circle.) I always use PNG. Then set the filename and path.

Expand the Advanced area and click “RayTrace the scene” (orange circle). Then you need to tell it how many pixels you want. Go big. You can always shrink it later.

Click OK and generate your plot. Check it out, things may be fine.

Leveraging Ray Tracing in Ansys EnSight

If you want to make the plot even better, go back to the Save image dialog and click “Raytrace settings…” and move the Quality slider all the way to the right. Do know that it can take a while to ray trace a large image with lots of surfaces.

And this is what you get. Click on the image to see it larger.

There is are many more options in this tool. Spend some time exploring these features to get even better plots:

  • You can change the shading of the surface by double-clicking on the part in the “Parts” control and then setting the surface lighting parameters. To get there, click on advanced, scroll down, and expand General. I like to up shininess. Play with these to see what works best.
  • You can also create multiple views in the same window. Right mouse clock in the graphics window and select “Viewports” and pick what you want. You can’t ray trace but you can still get output of multiple windows.

Here is what the output looks like, whithot ray tracing. Not bad.

  • Sometimes you may want to make your part transparent. You can set that in the controls under General, where you can change the lighting.

And you get a very cool plot. I’m not sure when you would use it, but if you need it, it is handy. CFD users need this all the time.

The problem with this tool is that it has so many great features, you could burn a lot of time just changing things. But if you stick to the basics, you can take your plot to that next level for your website or brochure.

Plotting a single part in a multi-part file

There is one last detail to mention. What do you do if your model is an assembly but you only want to plot one part. EnSight treats a given RST file as one part. So you can’t really scope to just the part you want.

The solution is to open your RST file in Mechanical APDL and save out the parts you want to plot in a seperate result file. You do this with the APDL command: rsplit

Here are the steps:

  1. Get into APDL
  2. Use “set” to read the results file
  3. Select the elements you want as separate parts for plotting using standard APDL commands or the GUI.
  4. Create element components for them (cm,name,elem, or the GUI)
  5. Use rsplit to write an RST for each part: rsplit,all,all,cmname where cmname is the component name you created in step 4.
  6. This makes an rst file called cmname.rst. Now use this rst file for the above process

Let’s make a movie next

This post and the previous one focused on high-quality 2D plots. What if you want to show motion? Read on to the third post in the series to learn how to create outstanding videos in Ansys Mechanical – “3 – An update on outputting results in Ansys Mechanical: Making Videos

1 – An update on outputting results in Ansys Mechanical: Making High-Resolution Images

To support some new marketing efforts I had to make some different types of results output from models in Ansys Mechanical:

  • A 3D plot on a webpage
    Post 5
  • A physical printout on our 3D Printer
    Post 6

All of the posts are here.

This post is the first of six on what I’ve learned after fiddling around for a while. It is an update to an article I did back in 2009 on the same topic, as well as plotting well in Mechanical APDL

Getting high-quality Pixels in Ansys Mechanical

To get started, let’s meet our sample model, an impeller we were working with a while ago for some Additive Manufacturing simulation. The modal results are good for exploring plotting:

Getting an image file in Ansys Mechanical is pretty simple. You click on the object you want a plot of, then select Home > Insert > Images > “Image to File …”

The default preferences are good for most plots. You basically get what you see on the screen.

This is the dialog where we can start making some simple modifications to increase the quality. here is how it comes out. Click to see full size:

I’m not a big fan of that. It is OK for sticking in an email or small on a PowerPoint. But I like better resolution, not just for marketing, but also to allow zooming.

The simplest change is to up the resolution – the number of dots per inch. First, you have to unclick the “Current Graphics Display.”

Playing with the resolution, here is the same image at the three different resolutions (1:1, 2:1, 4:1) (click to see it full size or look at the zoomed views below)

For most uses, the middle image, 2:1 is good enough. Image quality is driven by the number of color dots, or pixels. The base size is determined by how big the window is on your monitor. For this part the images are:

ScalePixel SizeFile Size
1:1939 x 621140 KB
2:1878 x 1242349 KB
4:13756 x 2484884 KB

But if we zoom in we can see the difference. You really only need the 4:1 for printing, or as we needed, the ability to blow it up for a booth or banner.

1:1
2:1
4:1

The blue-to-white gradient looks good on the screen and cuts down on eye fatigue, but can be a pain for images, especially if you are removing backgrounds or pasting into other documents. So the next thing I always do is change the background to white:

And you get a great picture, here it is 2:1, white background:

With the white background, it is easy to remove it, so you can place things behind it. That is very handy in PowerPoint.

If you are not familiar with that feature in Microsft Office applications, it is under: Picture Format > Adjust > Color > Set Transparent Color. Then click on a white pixel in your image.

This example shows a gray background, but it works with much fancier backgrounds. Here is the impeller in Sedona, Arizona.

I deleted the white background, the key, and the triad in Photoshop. I usally turn off the scale and triad in Ansys Mechanical: Display > Show then pick what you want on your plot.

These plots all use solid colors for each contour band, which is easier to read if you are doing actuall engineer. But if we are making marketing plots, I swap to smouth contours: Result > Display > Contours > Smooth Contours.

With a little Photoshop work you can get somethign pretty snazzy:

The last thing to talk about is what format to save in. This used to make a big difference because some of the formats traded quality for file size. But now the quality of the more efficient files is good.

You chose the format when you specify the file name. The choices are PNG, JPEG, TIFF, Windows Bitmap, and EPS.

As you can see in the closeup below, the different format really don’t lose quality, but their size varies a lot. Take a look at the next image, I can’t spot the difference. I recommend PNG because it is small but doesn’t lose any quality. But if you have a lot of plots and size is an issue, use JPEG. I have no idea why TIFF and especially Windows Bitmap or so large, but unless someone asks you for those formats, I’d avoid them.

Which leads us to the EPS or Encapsulated Postscript format. This is the last option. Now, EPS is usually what we call a vector format – not pixels but actual shaded polygons. The advantage of vector is that you can scale it up and down all you want and nothing is lost. The image is always sharp.

So you may get excited when you see EPS. In Ansys Mechanical APDL it does create a vector file (a way to get vector graphics of your results if you need them. Use /show,PSCR,,,8) But Ansys Mechanical just creates a bitmap image and puts it into Postscript format. It is not vector. You can see this if you open it in Adobe Illustrator. Bummer.

I hope this helps, and for 90% of your plotting needs, these tips should get the job done. But if you want to go further, read on to the next post in the series: “2 – An update on outputting results in Ansys Mechanical: Taking it to the Next Level with Ansys EnSight

ANSYS How To: Result Legend Customization and Reuse

ansys-mechanical-custom-legend-0A user was asking how to modify the result legend in ANSYS Mechanical R17 so Ted Harris put together this little How To in PowerPoint:

padt_mechanical_custom_legend_r17.pdf

It shows how to modify the legend to get just what you want, how to save the settings to a file, and then how to use those seettings again on a different model.  Very simple and Powerful.

ansys-mechanical-custom-legend-1

 

 

ansys-mechanical-custom-legend-2

Have You Ever Dreamed in Color – 3D Color? 3D PDF Is Here with VCollab!

VCollab_Shaded_Logo_FinalIf you have ever dreamed of, or at least had a need for a 3D .pdf file and soda pdf software of your simulation results , the dream is now realized thanks to VCollab.  As Eric Miller mentioned in The Focus blog back in February, the latest release of VCollab software enables users to save their results in 3D .pdf format.

We’ve now had a chance to test out the capability here at PADT, and we find it quite useful.  We’ve talked about VCollab before, but it’s a software suite that enables virtual collaboration (hence the name) by reducing what may be huge simulation files to a much smaller size, enabling others in your organization or your customers to dynamically view simulation results as well as CAD data in a light-weight viewer.  The folks at Vcollab have gone one step beyond that now by supporting the 3D .pdf format that is viewable in the standard Adobe reader.

Vcollab works with ANSYS results as well as results from lots of other simulation tools.  The process is:

You can download the sample file used in the images below:

vcollab-3d-pdf-sample-bolted1.pdf.

This is what a typical 3D .pdf file created from an ANSYS Mechanical/MAPDL results file looks like, with using the mouse to rotate and zoom around within Adobe reader.

So, if you recognize value in being able to create 3D .pdf files like this, the Vcollab software suite is worth investigating.  Vcollab does lots of useful things besides writing 3D .pdf files, including the capability to be imbedded within the ANSYS Engineering Knowledge Manager (ANSYS EKM) tool.

The best way to see the power of this tool is to request a demo.  Just fill out this form and we will reach out and set one up, followed by a 30 day trial.  .

Or check out www.vcollab.com.

Put 3D Simulation Results into 3D PDF with VCollab

VCollab_Shaded_Logo_FinalPDF has become a great, versatile format for sharing electronic documents. But engineers doing simulation were stuck with only being able to include 2D images in their PDF files. With the release of a new Plugin for VCollab Professional, you can include 3D model and result plots right in your PDF files.  A great way to archive, a great way to share.

You can see the results by checking out these two examples:

Here is a small example of a car front: vcollab-3dPDF-example-carfront

And here is the full car: vcollab-3dPDF-example-car

You can read the full press release here.

  vcollab-3dpdf-airplane1    

PADT uses VCollab to convert our CAD geometry and simulation results in to smaller, portable formats that can be imbedded in to PowerPoint, Word, websites, portals, PLM/PDM systems, etc…  It is a great way to view complicated data without having to fire up the full simulation tool.  And the files are much smaller than a full result file, so it also is a great way to get key results off of a remote server and interact with them quickly and efficiently.

Now with 3D PDF support the end user doesn't even have to have a Microsoft Office product or be on the web, they can just view it in their Adobe Acrobat reader.  If you are interested in trying out VCollab to make 3D PDF content or for any other application, contact us at sales@padtinc.com or call 1.800.293.PADT or 480.813.4884. We can arrange for a demonstration over the web, provide you with a trial copy, and work out the best configuration for your needs.