Fluids

Fluids

Undeclared variable TP_POS

    • sidkamat
      Subscriber

      Hi. I am trying to add an additional force on the tracked particle in the DPM. I am getting the error "TP_POS: undeclared variable" for the following UDF:


      /*UDF for calculating DEP force*/

      #include "udf.h"

      #include "dpm.h"

      #include "dpm_types.h"

      #define pi 3.141592

      /*Define parameters*/

      #define km 1.0

      #define epsilon 8.85e-12

      #define D 1.0e-6

      #define L 10.0e-6

      #define alpha 1130

      #define V 7000

      #define R2 1.111/100

      #define R1 0.794/100

      DEFINE_DPM_BODY_FORCE(DEP,tp,i)

      {

      real beta=L/D;

      real xi=beta/sqrt((beta*beta-1));

      real c1=atan(xi);

      real f=xi*((1-xi*xi)/c1+xi);

      real Fd=0;

      if(TP_POS(tp)[0]>=0.366)

      {

      Fd= (-1*pi*km*epsilon*D*D*L/6)/(alpha/(alpha-1)-f)*(V/log(R2/1))*(V/log(R2/1))*1/TP_POS(tp)[1];

      }

      else

      Fd=0;

      return(Fd/P_MASS(tp));

      }


      Can anyone identify what is wrong?

    • DrAmine
      Ansys Employee
      Which release version are you using?
    • sidkamat
      Subscriber
      I'm using 21.1.0
    • DrAmine
      Ansys Employee
      Weird. Csn you try a simpler UDF without the define section ( the pre-processor type). Also remove the empty line below the macro. Please report back
Viewing 3 reply threads
  • You must be logged in to reply to this topic.