Fluids

Fluids

How can i remove Floating Error in following UDF?

    • Azim07
      Subscriber

      Hello Guys,

      I want to define the specific heat and viscosity of the material by following UDF and it is showing 'Floating Exception Error'. How can i Fix this? And what kind of precautions i should take to avoid any further Error?


      and can it be fixed by reducing time step size? I used 0.5 and 0.1



      #include "udf.h"
      DEFINE_SPECIFIC_HEAT(cp_pcm,T)
      {
      real cp;
      if (T<303)
      cp=1250;
      else if (T>=303 && T<=304)
      cp=125000;
      else 
      cp=1250;
      return cp;
      }


    • Azim07
      Subscriber

      DEFINE_PROPERTY (cell_viscosity1,c,t)
      {
      real mu;
      real temp = C_T(c,t);
      if(temp<303)
      mu=100000000;
      else if (temp>304)
      mu=0.008;
      else
      mu =(15200000000-(50000000*temp));
      return mu;
      }

    • Rob
      Ansys Employee

      How about using ONE thread to hold all your linked questions?  Otherwise I'll just start locking the new ones. 


      If you set a constant value in the model with the above values does it work?  You did read the bit about UDFs using SI units? 

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