Fluids

Fluids

How to Parse Error in Viscosity UDF?

    • Azim07
      Subscriber

      I want to define the Viscosity property of the material in the form of following Equation.


      mu =(0.00727)+((((-8.6022)+(1871.3/temp)+(0.0152*temp)-(0.000012043*temp*temp))-(0.00727))/1+(exp((10/343-temp)*(temp-321.35))))


       


      and I have written the UDF as follow which shows the Parse Error in the Line 7.


       


      #include "udf.h"


      DEFINE_PROPERTY(cell_viscosity,c,t)


      {


      real mu;


      real temp = C_T(c,t);


      mu =(0.00727)+((((-8.6022)+(1871.3/temp)+(0.0152*temp)-(0.000012043*temp*temp))-(0.00727))/1+(exp((10/343-temp)*(temp-321.35))))


      return mu;


      }


       


      Please help me to fix this Parse Error if any other changes to be done.


      Thanks.


       

    • Rob
      Ansys Employee

      Read some of the examples, and look how C language terminates lines of code. 

    • Azim07
      Subscriber

      Thanks for your reply 


       


      It is showing floating exception Error.

    • Rob
      Ansys Employee

      OK, so the parse error is fixed? 

Viewing 3 reply threads
  • You must be logged in to reply to this topic.