2.2.10.  DEFINE_REPORT_DEFINITION_FN

2.2.10.1. Description

DEFINE_REPORT_DEFINITION_FN is a macro that you can use to specify a UDF for reporting a single-valued expression that can be plotted, written, or printed to the console as a report definition.

2.2.10.2. Usage

The DEFINE_REPORT_DEFINITION_FN macro takes a single argument, name, as the name of the function you are creating. Your user-defined function should return a real value that will be the value of the report definition.


Note:  If you need to access the value of another report definition, use the Get_Report_Definition_Values macro.


DEFINE_REPORT_DEFINITION_FN (name)

Argument Type

Description

symbol name

name of the user defined report definition function

Function returns

real

2.2.10.3. Example

This function computes the volumetric flow rate at an inlet, demonstrating the ability to perform operations on an input variable and output the result for plotting, printing, or writing to a file as part of a user-defined report definition.

#include "udf.h"
DEFINE_REPORT_DEFINITION_FN(volume_flow_rate_inlet)
{ 
  real inlet_velocity = Get_Input_Parameter("vel_in"); 
  real inlet_area  =  0.015607214;
  real volumeFlow = inlet_velocity*inlet_area;  
  return volumeFlow;
}

Note:  This example uses the Get_Input_Parameter API, indicating that this Fluent case file has the inlet velocity specified as an input parameter.


2.2.10.4. Hooking a User Defined Report Definition to ANSYS Fluent

After the UDF that you have defined using DEFINE_REPORT_DEFINITION_FN is interpreted (Interpreting UDFs) or compiled (Compiling UDFs), the name of the argument that you supplied as the first DEFINE macro argument (for example, on_demand_calc) will become visible and selectable in the User Defined Report Definition dialog box in Fluent. See User Defined Report Definition Function Hooking in the Fluent User's Guide for details.


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