CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF to extract particle positions and velocities at outlet (https://www.cfd-online.com/Forums/fluent-udf/167371-udf-extract-particle-positions-velocities-outlet.html)

marauder February 29, 2016 07:11

UDF to extract particle positions and velocities at outlet
 
I have two individual runs where the DPM particle's velocities and positions at outlet in first run are to be used as an input DPM file injection (.inj) at the inlet of second run.

Can anybody suggest a method to extract the particle profile at the outlet surface required to create the injection file?
:(

marauder February 29, 2016 22:58

any idea anyone? :(

`e` February 29, 2016 23:39

Write the particle positions (P_POS) and velocities (P_VEL) to a text file called say myOutletParticles.inj and then use this file for your second run. Ensure you use the proper format for the injection file (x y z u v w...).

marauder March 1, 2016 00:15

Quote:

Originally Posted by `e` (Post 587469)
Write the particle positions (P_POS) and velocities (P_VEL) to a text file called say myOutletParticles.inj and then use this file for your second run. Ensure you use the proper format for the injection file (x y z u v w...).

Hey thanks for that, i was able to print velocities using P_VEL but I'm getting following error for P_POS in the following code, can you help?

P_POS: undeclared variable

code:

#include "udf.h"
DEFINE_DPM_OUTPUT(history,header,fp,p,t,plane)
{

if(header)

printf("This is a test\n");
else
{

if(p==NULL)
;

else{

printf("%10.6f %10.6f %10.6f \n",P_VEL(p)[0],P_VEL(p)[1],P_POS(p)[0]);

}

}

}

`e` March 1, 2016 04:09

Are you compiling or interpreting this UDF? Compiling UDFs is generally the more stable and reliable method.

marauder March 1, 2016 12:33

Thanks compiled finally after installing visual studio etc. Seems to be working!


All times are GMT -4. The time now is 18:45.