fluent.com home page

   
 

Tips and Tricks on Advanced Creation of FLUENT Animations

 

Selected frames from an animation of the flowfield inside a spray dryer

One of the best ways to convey your CFD results to others is through animations. For transient simulations, animations allow you to show changes in one or more parameters as a function of time. For steady-state simulations, the flowfield can be animated using pathlines moving through the domain. Read on to learn tips and tricks on how to make animations for both types of analyses. The process of making animations is divided into two steps: generating the images and animating the images.

Generating the images

Time-dependent simulations

If you are running a transient simulation and want to capture images more often than you want to save data files, you can enter graphics commands through the graphical user interface (GUI) that will generate figures and save them to files throughout your calculation using an interval of your choice. In the Monitor Commands panel (Solve/Monitors/Command), you can enter groups of commands for this purpose, providing instructions to create (or modify) a figure and subsequently write the figure to a hardcopy file. Since you will be entering text commands in this panel, it is a good idea for you to practice with the text interface first to make sure that you issue the commands correctly.

(click image for enlarged view)

In the panel shown , the first command is used to generate a display of temperature contours ranging from 530°R to 3300°R every fifth time step (the units are those used for the simulation). The second command is used to generate the hardcopy file. The ' %t ' option in the naming convention adds the time step number to the file name. Note that you could use a ' %i 'option to add the iteration number or a ' %n 'option to add the number of the hardcopy file created in the session. While this method is ideally suited for time-dependent flows, you could also save images during the convergence phase of a steady-state simulation, using the ' %i 'naming system.

It is important to set the stage for your images before you begin the calculation. This includes selecting one or more surfaces for plotting (3D simulations only), adjusting the scale and spacing of vectors, or manipulating the display of some of the elements in the scene (for example, making the outer wall 75% transparent in a 3D view). Before launching the calculation, you also will need to open the Graphics Hardcopy panel (File/Hardcopy) and select a color TIFF format with your choice of resolution. Recommended resolutions are: high resolution (2100 x 1500 pixels) for printing or web-streaming and low resolution (1024 x 768 pixels) for PowerPoint presentations. If you click on Apply, these settings will be saved and used when the panel commands are issued. When your calculation is done, you will have a series of numbered TIFF files that can be animated, as described below.

Steady-state simulations

For steady-state flows, animations of pathlines show the motion of fluid elements around bodies, from the inlet to the outlet or in recirculation patterns. To animate these displays, several images containing pathlines of increasing length need to be created. To do this, begin by opening the Path Lines panel (Display/Path Lines). Experiment with the number of steps and step lengths to give a pleasing finished picture. For example, you may need 1000 steps for this purpose. Decrease the number of steps to a small number, for example 1, 2, or 5. Click on Display. Open the Animate panel (Display/Animate) and click on Add to add Key Frame 1, or Key-1 for your animation. Return to the Path Lines panel and increase the number of steps to the maximum number you will need. Click on Display. Return to the Animate panel. Increase the frame number to 30, 50, or 100, depending upon how many frames you want in your animation, and click on Add. Using the Playback buttons, play the animation to make sure it works the way you want. If you are satisfied with it, you can replay the animation, writing the frames to individual TIFF files, using the naming convention described above: name%n.tiff.

To create the TIFF files, select Hardcopy Frames from the Write/Record Format drop-down list, and click on Hardcopy Options. Select the TIFF format with the desired resolution and options, click on Apply, and close the panel. In the Animate panel, click on Write. Enter the name of the files, name%n.tiff, in the Animation File text entry box. When you click on OK, the animation will play and each frame will be written to a numbered file. Alternatively, you can write the animation to a single MPEG movie file. Select MPEG from the Write/Record Format drop-down list, and click on Write. Enter the name of the file in the Animation File text entry box and click on OK to begin making the file.

Generating image files from previously saved data files

If you have a set of data files spaced by even time intervals, cre- ated using the autosave facility, you will need to open each data file to make the images for the animation. This can be done man- ually or by using a script file (for UNIX platforms), or a journal file (for both UNIX and NT platforms). Instructions for these procedures can be found in the User Services Center, Solution Report 229, Sections 2 and 3.

Animating the images

UNIX platform

On UNIX platforms, software from ImageMagick can be used to animate a series of TIFF (or other format) files. It can also be used to perform other image manipulation functions, some of which are described below. This software is provided with Fluent Inc. product releases in the Fluent.Inc/contrib directory, along with the related copyright information and documentation. The command that you will use to make animations is simply "animate" followed by the list of files, which can be identified using the wildcard "*". For example, at your system prompt, you can type: animate *.tiff &. This command will link together all of the TIFF files in numerical order and play them as an animation. An improved animation can usually be obtained by converting the TIFF files to MIFF files, a format native to this software. To con- vert to MIFF files, type: mogrify -format miff *.tiff. You can play the animation using the command: animate *.miff &. If you want to create an animated GIF movie, you will need to convert your TIFF files into GIF format. Begin by converting the file format using the mogrify command:
mogrify -format gif *.tiff. The GIF files can be joined to form an animation using the convert command:
convert -adjoin -delay 20 *.gif movie-name.gif. The delay value is the time, in hundredths of a second, between frames. By decreasing this value, you can make the animation play faster.

NT platform

To convert the TIFF files to GIF files on the NT platform, you need to use a program that will perform batch conversion of image formats. One example is the shareware program PaintShop Pro, which can be downloaded from www.jasc.com. Once the GIF files exist, they can be joined to create an animation using software such as the GIF Construction Set Professional from Alchemy Mindworks . This software also creates animations in AVI format, suitable for playing in PowerPoint presentations. Other products that create movies from a series of images are MainActor from Main Concept and ImageReady from Adobe . Still others exist, and it is worthwhile to explore and assess a number of packages to find one that best suits your needs.


Previous Article FluentNEWS Next Article