Fluent DPM UDF: How to refine DPM_OUTPUT?

  • 441 Views
  • Last Post 16 December 2019
BeginerModel posted this 17 April 2019

Hi All.

My goal is to remove a particle from the domain once it has reached a certain position and a certain velocity, and store the position of the particle when it is removed. I have written a UDF that prints the positions/velocities of all the particles in my domain, but I need to refine this to only remove particles which meet certain criteria. I was previously trying this with DPM_SCALAR_UPDATE but couldn't find a way to save the positions of the particles it was removing. Does anyone have any suggestions? My UDF (which I compile) is below.

 

Order By: Standard | Newest | Votes
BeginerModel posted this 17 April 2019

UDF:

*** DPM UDF to write particle positions to file (Apply to interior Blood) ******/
#include "udf.h"
#include "dpm.h"
#include "math.h"
#define REMOVE_PARTICLES TRUE
DEFINE_DPM_OUTPUT(particle-info,header,fp, p,t,plane)
{
if(header)
{
par_fprintf_head(fp,"X-Position Y-Position Z-Position X-Velocity Y-Velocity Z-Velocity Time \n ");
}
if(NULLP(p))
return;
par_fprintf(fp,"%d %" int64_fmt " %e %e %e %e %e %e %e \n",
P_INJ_ID(P_INJECTION(p)),p->part_id,P_POS(p)[0],P_POS(p)[1],P_POS(p)[2],P_VEL(p)[0],P_VEL(p)[1],P_VEL(p)[2],P_TIME(p));
#if REMOVE_PARTICLES
MARK_PARTICLE(p, P_FL_REMOVED);
#endif
}

abenhadj posted this 17 April 2019

Both approaches would work for removing particles. You can even use for the interior plane a proous jump condition with very very high permeability trap the particles and sample them there without using any UDF.

Best regards, Amine

anshs posted this 14 December 2019

Hello, I'm also writing code for DPM particles. May I know, how were you able to understand and write the above code? Any reference material?

Thank you.

abenhadj posted this 16 December 2019

Check the FLUENT customization manual

Best regards, Amine

Close