[Fluent Inc. Logo] return to home search
next up previous contents index

25.20.1 Animating the Solution

During the calculation, you can have FLUENT create an animation of contours, vectors, XY plots, monitor plots (residual, statistic, force, surface, or volume), or the mesh (useful primarily for moving mesh simulations). Before you begin the calculation, you will specify and display the variables and types of plots you want to animate, and how often you want plots to be saved. At the specified intervals, FLUENT will display the requested plots, and store each one. When the calculation is complete, you can play back the animation sequence, modify the view (for grid, contour, and vector plots), if desired, and save the animation to a series of hardcopy files or an MPEG file

Instructions for defining a solution animation sequence are provided in
Section  25.20.1. Sections  25.20.1 and 25.20.1 describe how to play back and save the animation sequences you have created, and Section  25.20.1 describes how to read a previously-saved animation sequence into FLUENT.



Defining an Animation Sequence


You can use the Solution Animation panel (Figure  25.20.1) to create an animation sequence and indicate how often each frame of the sequence should be created. The Animation Sequence panel (Figure  25.20.2), opened from the Solution Animation panel, allows you to define what each sequence displays (e.g., contours or vectors of a particular variable), where it is displayed, and how each frame is stored.

You will begin the animation sequence definition in the Solution Animation panel (Figure  25.20.1).

Solve $\rightarrow$ Animate $\rightarrow$ Define...

Figure 25.20.1: The Solution Animation Panel
figure

The procedure is as follows:

1.   Increase the Animation Sequences value to the number of animation sequences you wish to specify. As this value is increased, additional sequence entries in the panel will become editable. For each sequence, you will perform the following steps.

2.   Enter a name for the sequence under the Name heading. This name will be used to identify the sequence in the Playback panel, where you can play back the animation sequences that you have defined or read in. This name will also be used as the prefix for the file names if you save the sequence frames to disk.

3.   Indicate how often you want to create a new frame in the sequence by setting the interval under Every and selecting Iteration or Time Step in the drop-down list below When. ( Time Step is a valid choice only if you are calculating unsteady flow.) For example, to create a frame every 10 time steps, you would enter 10 under Every and select Time Step under When.

4.   Click the Define... button to open the Animation Sequence panel (Figure  25.20.2).

Figure 25.20.2: The Animation Sequence Panel
figure

5.   Define the Sequence Parameters in the Animation Sequence panel.

(a)   Specify whether you want FLUENT to save the animation sequence frames in memory or on your computer's hard drive. To save the animation sequence in memory, select In Memory under Storage Type. To save the animation sequence to your computer's hard drive as a graphics metafile, select Metafile under Storage Type. To save the animation sequence to your computer's hard drive as a pixmap image, select PPM Image under Storage Type.

figure   

Note that the FLUENT metafiles created for each frame in the animation sequence contain information about the entire scene, not just the view that is displayed in the plot. As a result, they can be quite large. By default, the files will be stored to disk. If you do not want to use up disk space to store them, you can instead choose to store them in memory. Storing them in memory will, however, reduce the amount of memory available to the solver. Note that the playback of a sequence stored in memory will be faster than one stored to disk.

figure   

An advantage to saving the animation sequence using the PPM Image option is that you can use the separate pixmap image files for the creation of a single GIF file. GIF file creation can be done quickly with graphics tools provided by other third-party graphics packages such as ImageMagick, i.e., animate or convert. For example, if you save the PPM files starting with the string sequence-2, and you are using the ImageMagick software, you can use the convert command with the -adjoin option to create a single GIF file out of the sequence using the following command.

        convert -adjoin sequence-2_00*.ppm  sequence2.gif

(b)   If you selected Metafile or PPM Image under Storage Type, specify the directory where you want to store the files in the Storage Directory field. (This can be a relative or absolute path.)

(c)   Specify the ID of the graphics window where you want the plot to be displayed in the Window field, and click Set. (The specified window will open, if it is not already open.)

When FLUENT is iterating, the active graphics window is set to this window to update the plot. If you want to maintain each animation in a separate window, specify a different Window ID for each.

6.   Define the display properties for the sequence.

(a)   Under Display Type in the Animation Sequence panel, choose the type of display you want to animate by selecting Grid, Contours, Pathlines, Particle Tracks, Vectors, XY Plot, or Monitor. If you choose Monitor, you can select any of the available types of monitor plots in the Monitor Type drop-down list: Residuals, Force, Statistics, Surface, or Volume.

The first time that you select Contours, Vectors, or XY Plot, or one of the monitor types if you select Monitor, FLUENT will open the corresponding panel (e.g., the Contours panel or the Vectors panel) so you can modify the settings and generate the display. To make subsequent modifications to the display settings for any of the display types, click the Properties... button to open the panel for the selected Display Type.

(b)   Define the display in the panel for the selected Display Type (e.g., the Contours or Solution XY Plot panel), and click Display or Plot.

figure   

You must click Display or Plot to initialize the scene to be repeated during the calculation.

See below for guidelines on defining display properties for grid, contour, and vector displays.

7.   Remember to click OK in the Solution Animation panel after you finish defining all animation sequences.

Note that, when you click OK in the Animation Sequence panel for a sequence, the Active button for that sequence in the Solution Animation panel will be turned on automatically. You can choose to use a subset of the sequences you have defined by turning off the Active button for those that you currently do not wish to use.

Guidelines for Defining an Animation Sequence

If you are defining an animation sequence containing grid, contour, or vector displays, note the following when you are defining the display:



Playing an Animation Sequence


Once you have defined a sequence (as described in Section  25.20.1) and performed a calculation, or read in a previously created animation sequence (as described in Section  25.20.1), you can play back the sequence using the Playback panel (Figure  25.20.3).

Solve $\rightarrow$ Animate $\rightarrow$ Playback...

Figure 25.20.3: The Playback Panel
figure

Under Animation Sequences in the Playback panel, select the sequence you want to play in the Sequences list. To play the animation once through from start to finish, click the "play'' button under the Playback heading. (The buttons function in a way similar to those on a standard video cassette player. "Play'' is the second button from the right--a single triangle pointing to the right.) To play the animation backwards once, click the "play reverse'' button (the second from the left--a single triangle point to the left). As the animation plays, the Frame scale shows the number of the frame that is currently displayed, as well as its relative position in the entire animation. If, instead of playing the complete animation sequence, you want to jump to a particular frame, move the Frame slider bar to the desired frame number, and the frame corresponding to the new frame number will be displayed in the graphics window.

figure   

For smoother animations, turn on the Double Buffering option in the Display Options panel (see Section  28.2.7). This will reduce screen flicker during graphics updates.

Additional options for playing back animations are described below.

Modifying the View

If you want to replay the animation sequence with a different view of the scene, you can use your mouse to modify (e.g., translate, rotate, zoom) it in the graphics window where the animation is displayed. Note that any changes you make to the view for an animation sequence will be lost when you select a new sequence (or reselect the current sequence) in the Sequences list.

Modifying the Playback Speed

Different computers will play the animation sequence at different speeds, depending on the complexity of the scene and the type of hardware used for graphics. You may want to slow down the playback speed for optimal viewing. Move the Replay Speed slider bar to the left to reduce the playback speed (and to the right to increase it).

Playing Back an Excerpt

You may sometimes want to play only one portion of a long animation sequence. To do this, you can modify the Start Frame and the End Frame under the Playback heading. For example, if your animation contains 50 frames, but you want to play only frames 20 to 35, you can set Start Frame to 20 and End Frame to 35. When you play the animation, it will start at frame 20 and finish at frame 35.

"Fast-Forwarding'' the Animation

You can "fast-forward'' or "fast-reverse'' the animation by skipping some of the frames during playback. To fast-forward the animation, you will need to set the Increment and click the fast-forward button (the last button on the right--two triangles pointing to the right). If, for example, your Start Frame is 1, your End Frame is 15, and your Increment is 2, when you click the fast-forward button, the animation will show frames 1, 3, 5, 7, 9, 11, 13 and 15. Clicking on the fast-reverse button (the first button on the left--two triangles pointing to the left) will show frames 15, 13, 11,...1.

Continuous Animation

If you want the playback of the animation to repeat continuously, there are two options available. To continuously play the animation from beginning to end (or from end to beginning, if you use one of the reverse play buttons), select Auto Repeat in the Playback Mode drop-down list. To play the animation back and forth continuously, reversing the playback direction each time, select Auto Reverse in the Playback Mode drop-down list.

To turn off the continuous playback, select Play Once in the Playback Mode list. This is the default setting.

Stopping the Animation

To stop the animation during playback, click the "stop'' button (the square in the middle of the playback control buttons). If your animation contains very complicated scenes, there may be a slight delay before the animation stops.

Advancing the Animation Frame by Frame

To advance the animation manually frame by frame, use the third button from the right (a vertical bar with a triangle pointing to the right). Each time you click this button, the next frame will be displayed in the graphics window. To reverse the animation frame by frame, use the third button from the left (a left-pointing triangle with a vertical bar). Frame-by-frame playback allows you to freeze the animation at points that are of particular interest.

Deleting an Animation Sequence

If you want to remove one of the sequences that you have created or read in, select it in the Sequences list and click the Delete button. If you want to delete all sequences, click the Delete All button.

figure   

Note that if you delete a sequence that has not yet been saved to disk (i.e., if you selected In Memory under Storage Type in the Animation Sequence panel), it will be removed from memory permanently. If you want to keep any animation sequences that are stored only in memory, you should be sure to save them (as described in Section  25.20.1) before you delete them from the Sequences list or exit FLUENT.



Saving an Animation Sequence


Once you have created an animation sequence, you can save it in any of the following formats:

Note that, if you are saving hardcopy files or an MPEG file, you can modify the view (e.g., translate, rotate, zoom) in the graphics window where the animation is displayed, and save the modified view instead of the original view.

Solution Animation File

If you selected Metafile or PPM Image under Storage Type in the Animation Sequence panel, then FLUENT will save the solution animation file for you automatically. It will be saved in the specified Storage Directory, and its name will be the Name you specified for the sequence, with a .cxa extension (e.g., pressure-contour.cxa). In addition to the .cxa file, FLUENT will also save a metafile with a .hmf extension for each frame (e.g., pressure-contour_0002.hmf). The .cxa file contains a list of the associated .hmf files, and tells FLUENT the order in which to display them.

If you selected In Memory under Storage Type, then the solution animation file ( .cxa) and the associated metafiles ( .hmf) will be lost when you exit from FLUENT, unless you save them as described below.

You can save the animation sequence to a file that can be read back into FLUENT (see Section  25.20.1) when you want to replay the animation. As noted in Section  25.20.1, the solution animation file can be used for playback in FLUENT independent of the case and data files that were used to generate it.

To save a solution animation file (and the associated metafiles), select Animation Frames in the Write/Record Format drop-down list in the Playback panel, and click the Write button. FLUENT will save a .cxa file, as well as a .hmf file for each frame of the animation sequence. The filename for the .cxa file will be the specified sequence Name (e.g., pressure-contour.cxa), and the filenames for the metafiles will consist of the specified sequence Name followed by a frame number (e.g., pressure-contour_0002.hmf). All of the files ( .cxa and .hmf) will be saved in the current working directory.

Hardcopy File

You can also generate a hardcopy file for each frame in the animation sequence. This feature allows you to save your sequence frames to hardcopy files used by an external animation program such as ImageMagick. As noted above, you can modify the view in the graphics window before you save the hardcopy files.

To save the animation as a series of hardcopy files, follow these steps:

1.   Select Hardcopy Frames in the Write/Record Format drop-down list in the Playback panel.

2.   If necessary, click the Hardcopy Options... button to open the Graphics Hardcopy panel and set the appropriate parameters for saving the hardcopy files. (If you are saving hardcopy files for use with ImageMagick, for example, you may want to select the window dump format. See Section  4.14.1 for details.) Click Apply in the Graphics Hardcopy panel to save your modified settings.

figure   

Do not click the Save... button in the Graphics Hardcopy panel. You will save the hardcopy files from the Playback panel in the next step.

3.   In the Playback panel, click the Write button. FLUENT will replay the animation, saving each frame to a separate file. The filenames will consist of the specified sequence Name followed by an animation sequence and a frame number (e.g., pressure-contour_1_0002.ps), and they will all be saved in the current working directory.

MPEG File

It is also possible to save all of the frames of the animation sequence in an MPEG file, which can be viewed using an MPEG decoder such as mpeg_play. Saving the entire animation to an MPEG file will require less disk space than storing individual window dump files (using the hardcopy method), but the MPEG file will yield lower-quality images.

As noted above, you can modify the view in the graphics window before you save the MPEG file.

To save the animation to an MPEG file, follow these steps:

1.   Select MPEG in the Write/Record Format drop-down list in the Playback panel.

2.   Click the Write button.

FLUENT will replay the animation and save each frame to a separate scratch file, and then it will combine all the files into a single MPEG file. The name of the MPEG file will be the specified sequence Name with an .mpg extension (e.g., pressure-contour.mpg), and it will be saved in the current working directory.



Reading an Animation Sequence


If you have saved an animation sequence to a solution animation file (as described in Section  25.20.1), you can read that file back in at a later time (or in a different session) and play the animation. Note that you can read a solution animation file into any FLUENT session; you do not need to read in the corresponding case and data files. In fact, you do not need to read in any case and data files at all before you read a solution animation file into FLUENT.

To read a solution animation file, click the Read... button in the Playback panel. In the resulting Select File dialog box, specify the name of the file to be read.


next up previous contents index Previous: 25.20 Additional Options in
Up: 25.20 Additional Options in
Next: 25.20.2 Importing and Exporting
© Fluent Inc. 2006-09-20