DEFINE_DPM_BC simple reflect at wall
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 |
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. |
Thanks a lot. If I want to extract particle impact angle and velocity. How should I realize this?
|
Code:
DEFINE_DPM_BC(example,p,t,f,f_normal,dim) |
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?
|
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.
|
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 |
All times are GMT -4. The time now is 22:10. |