1. Help Center
  2. Fluent
  3. Expressions and scripts

How to Extract and Save Custom Results in ANSYS Fluent

Learn how to create expressions to compute results, monitor their evolution, and save them in ANSYS Fluent.

Sometimes, the phenomena studied in CFD require the calculation of a specific variable or quantity. For example, consider the 'Swirl Number' in turbomachinery, which is defined by the following equation:

       

It is calculated at the inlet of the draft tube of a hydro turbine. Here, U is the axial flow velocity, V is the tangential flow velocity, r is the radial position, and R is the radius of the cross-section.

.

In Fluent, we can use expressions to define the equation, create a monitor to track its evolution during the simulation, and save the data to a file. Below is the step-by-step procedure:

  1. Define the expressions

    One or more expressions can be used to define the equation. In this step, we will create five expressions:

    * Exp1 represents the numerator,
    * Exp2 represents the denominator,
    * IntExp1 is the area integral of Exp1
    * IntExp1 is the area integral of Exp2, and
    * Sw is the final expression that performs the calculation.
    .
    In Fluent, go to the 'User-Defined' Tab > Named Expressions > New. Assign a name and the equation ('planeswirl' is the name of the plane/surface where the calculation is computed).

           

  2. Create and set up the monitor

    Go to the 'Solution' Tab > Definitions > New > Expression... 

    Provide a name, select the expression form the list and check the reporting options shown below. Click Ok to continue.


      .
    • Monitor the evolution and use the saved file

      During the simulation, the current value of Sw will appear on the screen, and a report file will be written and saved on the local directory. You will have access to it once the simulation is finished or stopped.  Here it was opened using Notepad, but Excel can be used as well (Separate the data in columns).


      And this concludes this blog. I hope this procedure may help in your simulations. For more information, please read our blogs or our website to know more about us.

      Follow us on LinkedIn!