|
[Sponsors] |
March 30, 2015, 14:29 |
particles escaping instead of aborting
|
#1 |
New Member
anonymous
Join Date: Mar 2015
Posts: 25
Rep Power: 11 |
I'm trying to have the particles "stick" or abort their paths at the wall with these particular boundary conditions but they are being labeled as escaped by fluent during the dpm. Anyone else seen this?
PHP Code:
|
|
March 30, 2015, 17:00 |
|
#2 |
New Member
anonymous
Join Date: Mar 2015
Posts: 25
Rep Power: 11 |
I believe it may be my else statement at the end.
|
|
March 30, 2015, 17:11 |
|
#3 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
If they're being reflected then that suggests that 'vmag' is always greater than 'capture_vel'. A velocity of 1000 m/s is about Mach 3 in air... what context has particles travelling at this speed?
|
|
March 30, 2015, 17:18 |
|
#4 |
New Member
anonymous
Join Date: Mar 2015
Posts: 25
Rep Power: 11 |
It doesn't represent anything real, I wanted to try to force everything to bounce off the wall and exit. My previous udf had only about 2% of the mass exiting the domain and I was thinking that my udf wasn't telling the particles to return to their path if they didn't meet the capture velocity criteria.
|
|
March 30, 2015, 18:02 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
If the capture velocity is less than the particle velocity at the wall then they should stick (according to PATH_ABORT). Try printing a message when the code reaches the line before aborting the particle path to check whether or not this line of code is being executed.
Code:
/*Stop tracking the particle*/ Message("A particle is about to be aborted...\n"); return PATH_ABORT; |
|
March 31, 2015, 04:29 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Just a minor point: when your particles are smaller than the capture velocity, your code effectively does this:
Code:
for(i=0; i<dim; i++) P_VEL(p)[i] = 0; } return PATH_ABORT; |
|
March 31, 2015, 21:42 |
|
#7 |
Member
Join Date: Mar 2015
Posts: 30
Rep Power: 11 |
you just used exactly same code as i used, in determining the particle impacting on the wall!!! vmag cannot exceed 1000m/s right???
|
|
April 6, 2015, 12:11 |
|
#8 |
New Member
anonymous
Join Date: Mar 2015
Posts: 25
Rep Power: 11 |
Yes, true the velocity cannot be that high. I was testing my udf to force everything to stick by putting a velocity that I know would not be possible.
I had my original UDF set up incorrectly. I had the velocity capture part set up right but I forgot to tell the particle what to do (continue on its path) if it didnt meet the criteria. |
|
April 6, 2015, 12:12 |
|
#9 | |
New Member
anonymous
Join Date: Mar 2015
Posts: 25
Rep Power: 11 |
Quote:
|
||
April 7, 2015, 05:36 |
|
#10 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
I was going over the same example in the UDF manual today, could you tell what is the point of adding and then subtracting the same normal component from the particle velocity.
Also how does the above code actually make the particle reflect, i think it is just making the particle hit the wall again with a slightly smaller velocity again and again? |
|
April 7, 2015, 06:31 |
|
#11 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
They're not adding and removing the normal velocity from the particle. They're evaluating the normal velocity of the particle, storing this value in the variable 'vn', and then removing this value from the particle (therefore the particle is motionless). Next, they apply a new reflected velocity to the particle based on 'vn' but scaled back by a coefficient of restitution.
|
|
April 7, 2015, 06:39 |
|
#12 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Shouldn't the new reflected velocity have a negative component to change its direction (reflected), what they have done appears to be just reducing the velocity of the particle by a certain coefficient, that i think will not make it change its direction to be reflected, it will still be moving towards the wall just with a changed velocity and a different angle maybe?
|
|
April 7, 2015, 07:24 |
|
#13 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Ok, let's work through this reflection code with an example.
Suppose our particle exists in 2-D and has a velocity vector p = (3,-2) m/s. The wall is parallel to the x-axis and therefore has a normal unit vector of n = (0,1). Units are absent to keep simplicity in the following text. Code:
/* Compute normal velocity. */ for(i=0; i<idim; i++) vn += P_VEL(p)[i]*normal[i]; Code:
/* Subtract off normal velocity. */ for(i=0; i<idim; i++) P_VEL(p)[i] -= vn*normal[i]; Code:
/* Apply tangential coefficient of restitution. */ for(i=0; i<idim; i++) P_VEL(p)[i] *= tan_coeff; p = p*tangential_coefficient = (3,0)*0.5 = (1.5,0) (the tangential speed is reduced but the direction remains the same) Code:
/* Add reflected normal velocity. */ for(i=0; i<idim; i++) P_VEL(p)[i] -= nor_coeff*vn*normal[i]; p = p - normal_coefficient*vn*n = (1.5,0) - 0.5*(-2)*(0,1) = (1.5,1) (the normal speed is reduced and changes direction) Code:
/* Store new velocity in P_VEL0 of particle */ for(i=0; i<idim; i++) P_VEL0(p)[i] = P_VEL(p)[i]; As we expect, our reflected velocity, (1.5,1) m/s, has been reduced and directed away from the wall. This code works. |
|
April 7, 2015, 09:40 |
|
#14 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Best explanation ever! Thanks
|
|
April 8, 2015, 02:38 |
|
#15 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Could you tell why in the code originally posted above, the angle is calculated, i dont see it being use anywhere?
|
|
April 8, 2015, 04:03 |
|
#16 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The code in the original post of this thread is copied from an example in the UDF Manual. Perhaps the developers writing the manual wanted to provide this code for calculating the angle in case a user wanted this value.
|
|
April 8, 2015, 04:10 |
|
#17 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Hmm that makes sense.
Was just wondering if the angle of incidence is used in anyway in the reflected velocity calculation for this particular example, apparently it is calculated but not used. Actually that example is for reflected particles as well, and explaining the procedure it states 'First, the angle of incidence is calculated. Next, the normal particle velocity, with respect to wall...' So i thought I was just missing out on something. Thanks |
|
April 8, 2015, 04:16 |
|
#18 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
What might have happened, is developer A wrote the code using the angle of incidence (component-wise method). Then, a second developer B was tasked with optimising or reviewing this code and changed to using the dot product and normal vector but forgot to edit the comments and remove the angle calculation. Who knows, there's a few things in Fluent I don't understand their motivations for...
|
|
April 16, 2015, 00:55 |
|
#19 |
Member
Join Date: Mar 2015
Posts: 30
Rep Power: 11 |
Im just wondering what does this sentence do in this code? "if ((NNULLP(t)) && (THREAD_TYPE(t) == THREAD_F_WALL))
F_CENTROID(x,f,t);" |
|
April 16, 2015, 01:51 |
|
#20 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Code:
F_CENTROID(x,f,t); Code:
if ((NNULLP(t)) && (THREAD_TYPE(t) == THREAD_F_WALL)) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to determine the number of particles injected. | welch | FLUENT | 2 | January 18, 2024 05:08 |
trying to simulate two-phase jet flow with particles in surface injection | ajkratos | FLUENT | 5 | March 3, 2015 22:33 |
Conditional Release of DPM particles - UDF | nvschandra | Fluent UDF and Scheme Programming | 0 | December 10, 2013 12:02 |
particles model | ati_ros61 | FLOW-3D | 3 | December 6, 2009 17:03 |
Particles escaping geometry - through seams? | Jeremy | FLUENT | 1 | July 30, 2008 04:29 |