General

General

How do you use a parameter in the UDF?

    • FAQFAQ
      Participant

      A mutable input parameter can be used in the UDF in version 15.0 up to version 17.2 in the WorkBench. The parameter study of complex conditions using the UDF is also a possible execution. The UDF can access the input parameter by using the following macro: RP_Get_Input_Parameter(“Parameter name”) Starting from 17.0 up to 19.0 the macro changes for: Get_Input_Parameter(“Parameter name”) An example is visible in the documentation (version 19.0): #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; } (https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v190/flu_udf/flu_udf_sec_report_defintion.html ) It should be noted that up to versions 14.5.7, if you want to change the variables in the UDF source without recompiling, you can use the parameters in the UDF. However, it cannot be changed in the WorkBench.