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

Show velocity in message

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2015, 22:31
Question How can I set Y_velocity of particle =0, when particle attach the wall?
  #1
Member
 
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 11
YANNAPOL is on a distinguished road
Dear All,

The concept is

if (distance between particle and wall < .... )
particle_velocity_Y = 0;


I would like to set this particle velocity in Y axis =0, when the particle attach the wall.
Please kindly advise .....

Regards,
Yannapol S.

Last edited by YANNAPOL; June 5, 2015 at 05:13.
YANNAPOL is offline   Reply With Quote

Old   June 5, 2015, 05:20
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Do you want to set the y-velocity to zero when a particle really hits the wall (zero distance) or already when it is close to a wall?

If you want to do it when it hits the wall, it is easier, look for DEFINE_DPM_BC in the manual.
If you want to do it when it is close to a wall, it is complicated. It can be done, sure, but think about if you really want that.
pakk is offline   Reply With Quote

Old   June 5, 2015, 05:51
Default
  #3
Member
 
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 11
YANNAPOL is on a distinguished road
Dear pakk,

Thanks for your reply, at this moment, I will make it stop when it hit the wall.
As I understand the reference is set at the center of the particle. So if I need to set Y_velocity =0 when it hit the wall, my distance should be at the exact number of the particle radius. Am I understand correctly ?
How can I refer the Y_velocity of the particle ?
I am very new with C code and UDF code, could you please kindly advise ?

Is it the ...return PATH_ABORT;
if I use this particle will be suddenly stopped(does not move in any directions), am i right ?

Thank you in advance


Yannapol S.
YANNAPOL is offline   Reply With Quote

Old   June 5, 2015, 06:18
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by YANNAPOL View Post
Dear pakk,

Thanks for your reply, at this moment, I will make it stop when it hit the wall.
As I understand the reference is set at the center of the particle. So if I need to set Y_velocity =0 when it hit the wall, my distance should be at the exact number of the particle radius. Am I understand correctly ?
No, if you use DPM, then Fluent assumes your particles are small. So small that it only keeps track of the center position of your particle; your particle collides with the wall when the distance between the center and the wall is zero.

But, more importantly: you don't have to calculate this distance. If you use DEFINE_DPM_BC on the wall, the udf will only be used when the particle hits the wall. You don't have to check for that, Fluent will do that.

Quote:
How can I refer the Y_velocity of the particle ?
I am very new with C code and UDF code, could you please kindly advise ?
If you are very new to UDF code, I would advise you to read the manual. There you can see it is P_VEL(p)[1]. But really, check that manual. If you don't know how to refer to the y-velocity, you will have many more questions, and I am not going to look them all up for you in the manual.
Quote:
Is it the ...return PATH_ABORT;
if I use this particle will be suddenly stopped(does not move in any directions), am i right ?

Thank you in advance


Yannapol S.
No. The value that the DEFINE_DPM_BC returns, gives Fluent information about the fate of the particle. If you return PATH_ABORT, you tell Fluent to "abort" the calculation of the particle. So it will completely stop, as if it sticks to the wall. If you want the particle to stay active in the simulation, you should return PATH_ACTIVE.
pakk is offline   Reply With Quote

Old   June 6, 2015, 00:21
Default
  #5
Member
 
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 11
YANNAPOL is on a distinguished road
Dear pakk,

Thanks for your reply, from the tutorial,

#define DEFINE_DPM_BC(name, p, t, f, normal, dim) \
int name(Tracked_Particle *p, Thread *t, face_t f, real normal[], int dim)


The way Fluent define normal velocity is ....
the normal velocity = P_VEL(p)[i]*normal[i]

in my case tangential velocity is actually y-velocity, then I set P_VEL(p)[i]=0 to make particle stationary (velocity=0 in any directions).
BUT I use

for (i=0; i<idim; i++)
P_VEL(p)[i]=0;


Then, i let it show particle position. The particle is still moving.

Particle position is 8.91828e-05
Particle position is -1.50772e-05
Particle position is -4.51884e-05
.
.
Particle position is 6.21914e-05
Particle position is -1.02045e-05
Particle position is -7.82501e-05

Why the particle is still moving I set velocity =0 already ??

Best Regards,
Yannapol S.

Last edited by YANNAPOL; June 6, 2015 at 04:39.
YANNAPOL is offline   Reply With Quote

Reply

Tags
dpm, message log, udf, udf and programming


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
Problem with assigned inlet velocity profile as a boundary condition Ozgur_ FLUENT 5 August 25, 2015 04:58
unable to get parabolic velocity profile with pimplefoam houkensjtu OpenFOAM 4 October 8, 2012 04:41
WSS and normal velocity gradient for the slanted pipe wanna88 FLUENT 2 October 1, 2012 22:34
Problem with time average tangential velocity in swirl flow. lakhi FLUENT 5 July 18, 2012 16:28
Emergency:UDF for a time dependent parabolic velocity zumaqiong Fluent UDF and Scheme Programming 12 March 25, 2010 12:00


All times are GMT -4. The time now is 00:52.