CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF to extract particle positions and velocities at outlet

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By `e`

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 29, 2016, 08:11
Red face UDF to extract particle positions and velocities at outlet
  #1
Member
 
Anonymous
Join Date: Mar 2014
Posts: 84
Rep Power: 12
marauder is on a distinguished road
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 is offline   Reply With Quote

Old   February 29, 2016, 23:58
Default
  #2
Member
 
Anonymous
Join Date: Mar 2014
Posts: 84
Rep Power: 12
marauder is on a distinguished road
any idea anyone?
marauder is offline   Reply With Quote

Old   March 1, 2016, 00:39
Default
  #3
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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...).
`e` is offline   Reply With Quote

Old   March 1, 2016, 01:15
Default
  #4
Member
 
Anonymous
Join Date: Mar 2014
Posts: 84
Rep Power: 12
marauder is on a distinguished road
Quote:
Originally Posted by `e` View Post
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]);

}

}

}
marauder is offline   Reply With Quote

Old   March 1, 2016, 05:09
Default
  #5
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Are you compiling or interpreting this UDF? Compiling UDFs is generally the more stable and reliable method.
marauder likes this.
`e` is offline   Reply With Quote

Old   March 1, 2016, 13:33
Default
  #6
Member
 
Anonymous
Join Date: Mar 2014
Posts: 84
Rep Power: 12
marauder is on a distinguished road
Thanks compiled finally after installing visual studio etc. Seems to be working!
marauder is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Particle Injection induced from a UDF Peter023 Fluent UDF and Scheme Programming 3 November 26, 2018 04:55
advancing velocities and positions in pimpleDyMFoam fsaltara OpenFOAM 0 January 4, 2014 12:17
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 02:29
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 11:55
DPM - Particle velocities Umesh Shah FLUENT 2 April 3, 2003 13:55


All times are GMT -4. The time now is 22:30.