Fluids

Fluids

UDF- errors

    • Abdelrahman92
      Subscriber

      Hello


      I am trying to write UDF for non-Newtonian viscosity to account for shear rate induced by particles motion from DPM . When I compile it I got attached errors. can you help me what are they


      UDF for specifying a PL viscosity property
      **********************************************************************/
      #include "udf.h"
      #include "dpm.h"


      #define k_contin 0.451
      #define w 0.71


      DEFINE_PROPERTY(cell_viscosity, cell, thread)
      {
      real mu_lam;
      real P_velco, p_diame, defor_1, defor_2, defot;


      P_velco = P_VEL(p)[1];
      p_diame = P_DIAM(p);


      defor_1 = C_STRAIN_RATE_MAG(c,t);
      defor_2 = P_velco/p_diame;



      defot = sqrt(defor_1*defor_1+defor_2*defor_2);


      mu_lam = k_contin*pow(defot,w-1);
      return mu_lam;
      }

    • DrAmine
      Ansys Employee
      Udf is wrong. You need to loop over I ejections then over particles to get particle pointer. Easier to store any particle related information in cell memory in dpm scalar update udf.
Viewing 1 reply thread
  • You must be logged in to reply to this topic.