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

DEFINE_DPM_BC simple reflect at wall

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By pakk
  • 1 Post By pakk
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 23, 2014, 17:31
Default DEFINE_DPM_BC simple reflect at wall
  #1
New Member
 
junz
Join Date: Oct 2014
Posts: 13
Rep Power: 12
junz is on a distinguished road
Hi,
I just can't understand several code lines when studying the example in udf manual.

1. why need special treatment for 2d axisymmetric and swirl flows
and the code has if (R>1.e-20) {idim=3; normal[0]=f_normal[0];...}
why is 1.e-20?and why dimension changed to 3?

2. if (p->type==DPM_TYPE_INERT) what is the symbol ->?

I am new to udf and forget some C programming. Any help is greatly appreciated.
Thanks
junz is offline   Reply With Quote

Old   October 27, 2014, 12:38
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
1. If you are calculating 2d axisymmetric and swirl flows, your geometry is 2-dimensional (so variable "dim" is 2), but the velocity vector is 3-dimensional (so "idim" is defined as 3).
In the calculation of normal, you divide by the radius R. But if the radius is zero, this will give an error, because you can not divide by zero. If the radius is too close to zero, the result can be too big to store for the program. So to avoid these problems, the calculation of the normal is not done if you are close to the origin. 1e-20 is an arbitrary small value, it could also have been 1e-19 or 1e-21, I think.

2. About the symbol ->: "p->a" is short for "(*p).a". See this wikipedia page for more info.
junz likes this.
pakk is offline   Reply With Quote

Old   October 30, 2014, 11:02
Default
  #3
New Member
 
junz
Join Date: Oct 2014
Posts: 13
Rep Power: 12
junz is on a distinguished road
Thanks a lot. If I want to extract particle impact angle and velocity. How should I realize this?
junz is offline   Reply With Quote

Old   October 30, 2014, 11:37
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Code:
DEFINE_DPM_BC(example,p,t,f,f_normal,dim)
{
 // P_VEL(p) is the velocity vector of the particle
 // f_normal is the normal vector of the cell face that your particle hits
 //   (not of unit length, be careful)
}
So you need to do some basic trigonometry to get the angle.
junz likes this.
pakk is offline   Reply With Quote

Old   October 31, 2014, 00:24
Default
  #5
New Member
 
junz
Join Date: Oct 2014
Posts: 13
Rep Power: 12
junz is on a distinguished road
Oh, I got it. Thanks. One more question...is there any difference between use of position vector and use of velocity vector to get the impact angle? which is preferred?
junz is offline   Reply With Quote

Old   October 31, 2014, 04:12
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
I don't see how you can use the position vector (you mean the particle position vector?) to get the impact angle. So I would use the particle velocity vector and the face normal vector. You'll need both of them.
junz likes this.
pakk is offline   Reply With Quote

Old   November 8, 2014, 15:03
Default
  #7
New Member
 
junz
Join Date: Oct 2014
Posts: 13
Rep Power: 12
junz is on a distinguished road
Hello, I have another problem now. How can I export the particle position data to an excel? And how can I get to know the number of impacts of particles?
For both situations, do I need to write a udf? Thanks very much
junz is offline   Reply With Quote

Reply

Tags
udf dpm reflection


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
Divergence in AMG solver! marina FLUENT 20 August 1, 2020 12:30
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 4 December 2, 2019 01:04
Enhanced Wall Treatment paduchev FLUENT 24 January 8, 2018 12:55
Stationary Water-jet wall impingement Triccio CFX 2 July 9, 2014 20:43
Wall functions Abhijit Tilak Main CFD Forum 6 February 5, 1999 02:16


All times are GMT -4. The time now is 17:02.