28.17. Executing Commands During the Calculation

As described in Monitoring Solution Convergence and Animating the Solution, respectively, you can report and monitor various quantities (for example, residuals, force coefficients) and create animations of the solution while the solver is performing calculations. ANSYS Fluent also includes a feature that allows you to define your own command(s) to be executed during the calculation at specified intervals. For example, you can ask ANSYS Fluent to perform gradient adaption after a set number of iterations. You will specify a series of text commands or use the GUI to define the steps to be performed.


Important:  Note that the Calculation Activities task page provides options to perform the following during the calculation:

  • save case and data files

  • export transient solution files

  • export transient particle history data files

Each of these options has their own dialog box, which should be used rather than executing a command to perform them. See Automatic Saving of Case and Data Files and Exporting Data During a Transient Calculation for details.


You will indicate the command(s) that you want the solver to execute at specified intervals during the calculation using the Execute Commands Dialog Box (Figure 28.36: The Execute Commands Dialog Box).

 Solution → Calculation Activities → Execute Commands New...

Figure 28.36:  The Execute Commands Dialog Box

The Execute Commands Dialog Box

The procedure is as follows:

  1. Increase the Defined Commands value to the number of commands you want to specify. As this value is increased, additional command entries will become editable. For each command, you will perform the following steps.

  2. Enable the Active check button next to the command if you want it to be executed during the calculation. You may define multiple commands and choose to use only a subset of them by turning off the check button for those that you do not want to use.

  3. Enter a name for the command under the Name heading.

  4. Indicate how often you want the command to be executed 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 execute the command every 10 iterations, you would enter 10 under Every and select Iteration under When.


    Important:  If you specify an interval in iterations, be sure to keep the Reporting Interval in the Run Calculation Task Page at its default value of 1.


  5. Define the command by entering a series of text commands in the Command field, or by entering the name of a command macro you have defined (or will define) as described in Defining Macros.


    Note:  Make sure that the text commands you have entered in the Command field of the Execute Commands dialog box does not exceed 127 characters.



    Important:
    • If the command to be executed involves saving a file, see Saving Files During the Calculation for important information.

    • If the command enables or disables equations, you must disable the convergence check for these equations.


For additional information, see the following sections:


Release 18.2 - © ANSYS, Inc. All rights reserved.