We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
General

General

How to export plots automatically during a Fluent simulation using execute commands?

    • FAQFAQ
      Participant

      There are two ways to export images during a simulation: 1) Solution Animation 2) Execute Commands The solution animation approach is easy to set up, but the animation settings are not saved in the case file so must be redefined upon reloading Fluent. It also does not offer much control over how the animation is created. The execute commands approach does not face the same limitations. The settings are saved in the case file, and the images that are produced by this approach can be assembled by any image-to-video conversion software (there are many freely available online) providing you much more control in terms of frame rate and quality. Below are instructions on how to automatically export images using execute commands: 1. Determine the necessary TUI Commands: A. In the TUI, set the window in which you want to visualize the plots. Type display in the TUI. Press Enter. Many options will be displayed in the TUI. Type set-window. Enter any number. Eg : dis set-win 2. ( Window 2 will be active) B. Type set, press Enter. Then you can select contours/vectors/pathlines etc., . which you want to visualize. For example, in order to display contours, type contours. Press Enter. C. Then set the surfaces on which you want to visualize the contours. Type surfaces and provide the surface name/ID number. The ID numbers can be seen from “Surface -> Manage” panel. ID of the surface can be visualized by selecting the surface in that panel. Other options can also be set here. For example in order to visualize filled-contours, type filled-contours and answer yes. Eg : dis set contours surf 5 dis set con filled-con y D. Typing q in the TUI will take one level above. It will be “/display/set>” in the TUI. Type q once again in the TUI. It will be “display>”. Press Enter. Many options will be shown. You have to provide the variable for which you want to visualize the contours. Type contour. Series of questions will appear in the TUI one after another until all the required inputs are provided Eg : dis con vel-mag (in order to visualise contours of velocity magnitude) E. Once this is done, save the picture. Type save-picture. Give a file name. The extension should be consistent with the format selected initially in the “File > Save Picture” dialogue box. Eg: dis save-picture “pic-%06t.jpg”. ( %xt will ensure that the the saved picture names are associated with the appropriate time) 2. Set the TUI commands to be automatically executed at the desired interval using Execute Commands: A. Go to Calculational Activities > Execute Commands. Increase the “Number of Defined Commands” to the number of commands typed in the TUI. Enter the same commands typed in the TUI one by one in the “Command” dialogue box. Enable the “Active” button. Select either “Time step” or “Iteration” under “When”. Enter appropriate number under “Every”. If “time step” is selected and 1 is entered under “Every”, then pictures get saved for every 1 time step. Proceeding on the same lines, vectors, pathlines etc., can be displayed using TUI commands.