We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.
Ansys Products

Ansys Products

Discuss installation & licensing of our Ansys Teaching and Research products.

How to get Coalesced particle ID in Ansys Fluent?

    • rashed.islam
      Subscriber

      Hi, 

      I am currently using Coalesced-DPM model in Ansys Fluent to simulate API-Lactose particles for an inhaler inhalation related fluid problem. As an outcome, I want to find Aerodynamic Particle Size Distribution (APSDs) in the outlet. In order to do that, I need to know the particle ID of each coalesced particle due to agglomeartion/deagglomeration. 
      Is anyone please help me in this issue? 

      Thanks in advance.

      Rashed

    • Prashanth
      Ansys Employee

      Hi,

      Here are my comments from what I understand: coalesced particles are actually removed trajactories. If you want to track coalesced particles, you can use say DPM_SPRAY_COLLIDE, loop into the particles, check if some became bigger and mark or note them. You can check the UDF manual which uses this macro for a very simple coalescence model..

    • rashed.islam
      Subscriber

      Hi, 

      Thanks for your reply. 
      I checked on the DPM_SPRAY_COLLIDE and the given example by Ansys. I have few more questions on this macro.

      1. When does this macro triggered? Is this triggered when two particles are colliding each other? Or it is called during particle tracking after every particle time step? 
      2. What does p do in this UDF? Is this just a pointer or it is a list of all the paticles in a certain cell?
      3. Also, you mentioned to loop into the particles. Can I do that without introducing a new particle index *pi (used in the example UDF by Ansys given below) and loop through by only using only p and tp? Or is it even possible to track the coalesced particles without looping the particles?

      Please help me with this. It'll be a great help for me. 

      DEFINE_DPM_SPRAY_COLLIDE( name, tp, p)
      /***********************************************************
         DPM Spray Collide Example UDF 
      ************************************************************/
      #include "udf.h"
      #include "dpm.h"
      #include "surf.h"
      DEFINE_DPM_SPRAY_COLLIDE(mean_spray_collide,tp,p)
      {
        /* non-physical collision UDF that relaxes the particle */
        /* velocity and diameter in a cell to the mean over the */
        /* specified time scale t_relax */
      
        const real t_relax = 0.001; /* seconds */
      
        /* get the cell and Thread that the particle is currently in */
        cell_t c  = P_CELL(tp);
        Thread *t = P_CELL_THREAD(tp);
      
        /* Particle index for looping over all particles in the cell */
        Particle *pi;
      
        /* loop over all particles in the cell to find their mass */
        /* weighted mean velocity and diameter */
        int i;
        real u_mean[3]={0.}, mass_mean=0.;
        real d_orig = P_DIAM(tp);
        real decay = 1. - exp(-t_relax);
        begin_particle_cell_loop(pi,c,t)
          {
            mass_mean += P_MASS(pi);
            for(i=0;i<3;i++)
              u_mean[i] += P_VEL(pi)[i]*P_MASS(pi);
          }
        end_particle_cell_loop(pi,c,t)
      
        /* relax particle velocity to the mean and diameter to the */
        /* initial diameter over the relaxation time scale t_relax */
        if( mass_mean > 0. )
          {
            for(i=0;i<3;i++)
              u_mean[i] /= mass_mean;
            for(i=0;i<3;i++)
              P_VEL(tp)[i] += decay*( u_mean[i] - P_VEL(tp)[i] );
            P_DIAM(tp) += decay*( P_INIT_DIAM(tp) - P_DIAM(tp) );
            /* adjust the number in the droplet parcel to conserve mass */
            P_N(tp) *= CUB( d_orig/P_DIAM(tp) );
          }
      }
Viewing 2 reply threads
  • You must be logged in to reply to this topic.