Parse error while trying to interpret UDF in fluent

    • MForbes

      I am trying to write a UDF to define the viscosity of a 50/50 mixture of ethanol and water. Below is the temperature-dependent formula used to write the UDF and the code I am trying to implement. Every time I try to interpret the code it throws a parse error. Any help towards solving this issue would be greatly appreciated.


      µ (50/50 Water-Ethanol) [Pa sec] = 2.48 × 10−8 × T^3 [K] + 2.47 × 10−5 × T^2 [K] − 8.22 × 10−3 × T[K] + 0.92;

      #include "udf.h"

      DEFINE_PROPERTY(cell_viscosity, c,t) 

      real mu_lam; 

      real T = C_T(c,t);

      mu_lam = 2.48e-8 * pow(T,3.) + 2.47e−5 * pow(T,2.) − 8.22e−3 * T + 0.92;

      C_UDMI(c,t,2.) = mu_lam;

      return mu_lam;


    • Karthik R
      Hello Have you tried compiling this UDF? Also, did you define the necessary UDMIs for your simulation run?
    • Rob
      Ansys Employee
      Also, UDMs are integer indexes, 2. will cause a problem and is the third UDM in your system.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.