|
[Sponsors] |
October 23, 2014, 17:31 |
DEFINE_DPM_BC simple reflect at wall
|
#1 |
New Member
junz
Join Date: Oct 2014
Posts: 13
Rep Power: 12 |
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 |
|
October 27, 2014, 12:38 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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. |
|
October 30, 2014, 11:02 |
|
#3 |
New Member
junz
Join Date: Oct 2014
Posts: 13
Rep Power: 12 |
Thanks a lot. If I want to extract particle impact angle and velocity. How should I realize this?
|
|
October 30, 2014, 11:37 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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) } |
|
October 31, 2014, 00:24 |
|
#5 |
New Member
junz
Join Date: Oct 2014
Posts: 13
Rep Power: 12 |
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?
|
|
October 31, 2014, 04:12 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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.
|
|
November 8, 2014, 15:03 |
|
#7 |
New Member
junz
Join Date: Oct 2014
Posts: 13
Rep Power: 12 |
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 |
|
Tags |
udf dpm reflection |
|
|
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 |