CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Trapping particles (https://www.cfd-online.com/Forums/fluent/40932-trapping-particles.html)

Francisco Castellanos Rodriguez May 11, 2006 08:37

Trapping particles
 
Hi,

we are working on a fireplace modelling and we are really interesting in particles. We would like to know how could we visualize where the particles are trapped.

Thanks

Fran

Allan Walsh May 11, 2006 13:28

Re: Trapping particles
 
I'm assuming you have tried Display -> Particle Tracks and....?

Fran May 11, 2006 16:44

Re: Trapping particles
 
I have tried all the options ... actually I want to visualize the point of impact where particles are trapped. I have tried with the option concentration but the result is not what I'm waiting for... I don't know if you understand what I want

Thanks a lot for your answer

Steve Silvester May 12, 2006 10:33

Re: Trapping particles
 
Hi,

I wrote a simple little udf to do this. Compile it and hook it to the wall you're interested in through the boundary conditions panel (DPM>>Boundary Cond. Type>>User Defined Function - you'd normally set this to 'trap')then select the udf in Boundary Cond. Function>>dpm_report. Next display your particle tracks. Each time a particle hits the wall you specified the udf to be active on it'll abort the trajectory and write a couple of files. The first (dpm_report_xyz.txt) is just the x,y,z co-ordinates of the trapped particle, the second (dpm_report_injection_file.txt) writes a file which defines injection positions. (It writes it to the c:\ path but you can change this).

Next, define a new injection and set 'type' to file. Load up the 'dpm_report_injection_file.txt'. Next, set your 'max number of steps in the 'DPM' panel to 1 (so they don't budge) and display your particle tracks using the new injection you just created. Should display particle positions where they were trapped. If you want to include particle variables (diameter, temperature) then just change the udf to write these as well, currently they're all zero as I was only interested in position.

The particle positions may be slightly off the wall - it seems to write the position just before it hits, but this is a tiny distance. Likewise when you track them for one step, they will move imperceptibly because you've tracked them for a single step - but again, it's a controllable fraction.

Steve

#include "udf.h" DEFINE_DPM_BC(dpm_report,p,t,f,f_normal,dim) { FILE * f1; FILE * f2; float x=0; float y=0; float z=0; f1 = fopen ("C:\\dpm_report_xyz.txt", "a"); f2 = fopen ("C:\\dpm_report_injection_file.txt", "a"); x=P_POS(p)[0]; y=P_POS(p)[1]; z=P_POS(p)[2]; fprintf (f1, "%f %f %f\n",x,y,z); fprintf (f2, "(( %f %f %f 0 0 0 0 0 0 ) name )\n",x,y,z); fclose(f1); fclose(f2); return PATH_ABORT; }


Fran May 12, 2006 10:49

Re: Trapping particles
 
Hi,

Thanks a lots Steve. Your answer is very helpful.

Fran

Fran May 24, 2006 12:31

Re: Trapping particles
 
Hi,

I have tried to compile the udf but I got an error message undeclared variable P_POS. Have you an idea what can the error be? Thanks


Fran May 24, 2006 14:05

Re: Trapping particles
 
Hi

Again I have solved the problem with the undeclared variable P_POS but now I have a new problem: structure reference not implemented.


Steve Silvester May 28, 2006 13:27

Re: Trapping particles
 
Hi,

Are you interpreting it or compiling?, I don't get any errors when compiling. I can email you a compiled version that you can load up if it helps.

Steve

Fran May 31, 2006 16:17

Re: Trapping particles
 
Finally I arrived to the conclusion that I have a problem with my version of Fluent ... I tried to compile an example given in the manual book and it didn't work. I will uninstall Fluent and reinstall it. I will be very happy to get a compiled version. Thanks a lot Steve Fran


NH_Aus January 3, 2011 23:52

Quote:

Originally Posted by Steve Silvester
;132135
Hi,

I wrote a simple little udf to do this. Compile it and hook it to the wall you're interested in through the boundary conditions panel (DPM>>Boundary Cond. Type>>User Defined Function - you'd normally set this to 'trap')then select the udf in Boundary Cond. Function>>dpm_report. Next display your particle tracks. Each time a particle hits the wall you specified the udf to be active on it'll abort the trajectory and write a couple of files. The first (dpm_report_xyz.txt) is just the x,y,z co-ordinates of the trapped particle, the second (dpm_report_injection_file.txt) writes a file which defines injection positions. (It writes it to the c:\ path but you can change this).

Next, define a new injection and set 'type' to file. Load up the 'dpm_report_injection_file.txt'. Next, set your 'max number of steps in the 'DPM' panel to 1 (so they don't budge) and display your particle tracks using the new injection you just created. Should display particle positions where they were trapped. If you want to include particle variables (diameter, temperature) then just change the udf to write these as well, currently they're all zero as I was only interested in position.

The particle positions may be slightly off the wall - it seems to write the position just before it hits, but this is a tiny distance. Likewise when you track them for one step, they will move imperceptibly because you've tracked them for a single step - but again, it's a controllable fraction.

Steve

#include "udf.h" DEFINE_DPM_BC(dpm_report,p,t,f,f_normal,dim) { FILE * f1; FILE * f2; float x=0; float y=0; float z=0; f1 = fopen ("C:\\dpm_report_xyz.txt", "a"); f2 = fopen ("C:\\dpm_report_injection_file.txt", "a"); x=P_POS(p)[0]; y=P_POS(p)[1]; z=P_POS(p)[2]; fprintf (f1, "%f %f %f\n",x,y,z); fprintf (f2, "(( %f %f %f 0 0 0 0 0 0 ) name )\n",x,y,z); fclose(f1); fclose(f2); return PATH_ABORT; }

Hi Steve Silvester
I need to stop the dpm calculation and consider as trapped when the particle (centre) is xx distance away from the wall.

My case is 3d.

docnurulhasan@gmail.com

liliana May 23, 2013 19:47

Hello everybody.

I now this topic is old, but it is just what I need.

I need to visualiza or know how many particles are trapped on the wall, but I did my simulation on CFX.

The only to do this is using an UDF? There is no way to do this in CFD Post? I've been trying really hard and got no answer!

Thanks a lot!

diego123 September 6, 2017 18:25

EDITED: I FOUND A SOLUTION (SEE BOTTOM OF THE MESSAGE)


I can't believe this has been an issue for so long... still without an easy solution! I have tried to compile that UDF like a madman and there are a lot of issues with the new versions of Microsoft Visual Studio, SDK Command Prompt... (it's not like I am fluent in those, not at all, but showing the deposition pattern of particles shows like something quite standard in a DPM problem!)

If anyone knows of a better way to obtain them... I am listening, the most I've achieved is exporting the whole .his file for the particle tracks, but post-processing all that information manually seems too much work

SOLUTION
So I have found out that it is possible to show the deposition patterns of particles by enabling the erosion\accretion option under physical models of the DPM. It shall be noted that this enables particle-particle interaction so the number of particles trapped usually increases. Once you have run your simulation you can go to Contours\DPM and show the accretion, which shows the places where the particles have been trapped.

This may not be exactly what some of you are looking for but it was good enough to me!


All times are GMT -4. The time now is 07:56.