Fluids

Fluids

UDF thread question

Tagged: , ,

    • satri
      Subscriber

      I am doing DPM particle tracking in a 2d domain and I am using this statement in DEFINE_DPM_SCALAR_UPDATE UDF

          if (t==tf)
          {

          // t is particle thread

          // tf is the outlet face thread

          printf("xp= %g, yp=%g \n", xp[0],xp[1]);
          C_UDMI(c,t,1)=1;
          p->stream_index=-1;
          }

      I don't see anything that gets printed.

      I even tried enclosing the if statement in the 

      begin_f_loop(f,tf) 
      {
      end_f_loop(f,tf)
       
      am i doing anything wrong here?
      I am just trying to print the coordinates of the location where the particle is exiting the domain. And I am increasing the UDM to keep track of how many particles exited from the domain.
      Please let me know why UDM counter is not increasing as well as the particle coordinates are not printing?
    • Rob
      Ansys Employee

      The loop won't do anything as the particles aren't attached to the cells. 

    • satri
      Subscriber

      But isn't the particle passing through the cells?

    • Rob
      Ansys Employee

      Yes, but we track the particle rather than the cell it's in. Hence all of the DPM macros and why they're not very easy to use. 

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