Fluids

Fluids

Floating point exception error after loading UDF and running simulation.

    • NiteshDubey
      Subscriber

      I have loaded a UDF for the spatial variation of viscosity in my simulation. I am getting these errors. Need the help of experts. Any help will be highly appreciated.


       


      My UDF is:


       


      /*********************************************************************


      UDF that simulates  spatially dependent viscosity property


      **********************************************************************/


      #include "udf.h"


      #define a 20105467790.5412


      #define b 2.692576799425


      #define c 5083.56137738767


      #define d -84995.6051593393


      #define e -2230225.26461472


      #define f 852890049.062181


      #define g 502636694.742164


       


      DEFINE_PROPERTY(cell_viscosity, cell,thread)


      {


      real mu;


      real y, z;


      real ZB[ND_ND];


      C_CENTROID(ZB,cell,thread);


       


      y=ZB[1];    /* y cooridnate*/


      z=ZB[2];    /* z cooridnate*/


       


      mu=1.21 - 2.71*(a + b*(z-0.006) + c*pow(z-0.006,2.) + d*pow(z-0.006,3.) + e*pow(z-0.006,4.) + f*pow(z-0.006,5.) + g/(y+0.52347)) + 


      25.46*pow((a + b*(z-0.006) + c*pow(z-0.006,2.) + d*pow(z-0.006,3.) + e*pow(z-0.006,4.) + f*pow(z-0.006,5.) + g/(y+0.52347)),2.);


      return mu;


       


      }


       


      I did the following checks:


       


      1.  Mesh quality is good


      2.  Discretization scheme is second-order for momentum and pressure. For gradient, it is least-squares cell-based.


       


       


      Divergence detected in AMG solver: x-momentum Stabilizing y-momentum to enhance linear solver robustness.


       


      Divergence detected in AMG solver: y-momentum Stabilizing z-momentum to enhance linear solver robustness.


       


      Divergence detected in AMG solver: z-momentum Stabilizing pressure correction to enhance linear solver robustness.


       


      Divergence detected in AMG solver: pressure correction


      Divergence detected in AMG solver: x-momentum


      Divergence detected in AMG solver: y-momentum


      Divergence detected in AMG solver: z-momentum


      Divergence detected in AMG solver: pressure correction


      Error at host: floating point exception


       


       


      Error at Node 0: floating-point exception


      Error at Node 1: floating-point exception


       


      ===============Message from the Cortex Process================================


       


      Compute processes interrupted. Processing can be resumed.


       


      ==============================================================================


       


      Error: floating point exception


       


      Error Object: #f


       


       

    • Rob
      Ansys Employee

      Plot the function in Excel and see how it looks. Whenever I see coefficients with that many significant figures I always expect the curve to be very different to what you're expecting. 


      Also remember that UDFs use SI units: your coordinates are in metres regardless of the units in your model. 

Viewing 1 reply thread
  • You must be logged in to reply to this topic.