Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Particle tracing - particle counting

Please login with a confirmed email address before reporting spam

Hello to everyone,

Im new to COMSOL and currently trying to work with particle tracing for fluid flow.
The model we are working on is part of vascular network and we are using as physics : structural mechanics, laminar flow, darcy flow, and particle tracing for fluid flow. Everything is working up to the point where we can calculate the particles trajectories but we need to be able to calculate how many particles pass though a specific area section. I have tried to use the Total number of particles in selection, Particle density, Particle position from the results in order to accomplish this. Unfortunately when i try this i get the following error:

CANNOT EVALUATE EXPRESSION
failed to evaluate variable -
Geometry -
Domain -

I have tried to toggle " compute particle mass" on from the particle tracing menu but then when i do this and try to calculate the solution i get another error:

Solution cannot be updated. Clear Solution to expunge.
Failed to evaluate expression.
Failed to evaluate variable.
- Variable: mod1.mp
- Geometry: 2
- Boundary: 1
Failed to evaluate expression.
- Expression: mod1.mp


I have checked the example of laminar_mixer_particle and the model but at that particulate example it only calculates trajectories and nothing more.
I've also tried to export the particle coordinates (designated as q) to excel spreadsheet file so i can process them elsewhere but been also unsuccesfull at that.

If someone has a solution please respond
Thank you,

SM

21 Replies Last Post 2016年8月11日 GMT-4 14:50
COMSOL Moderator

Hello Stefanos Michael

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年8月10日 GMT-4 05:23
"cannot evaluate expression" means that the expression you selected does not fit to the kind of plot ur using ( slice, streamline or whatever). im still searching myself for certain combinations.. its kind of a guessing game
"cannot evaluate expression" means that the expression you selected does not fit to the kind of plot ur using ( slice, streamline or whatever). im still searching myself for certain combinations.. its kind of a guessing game

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年10月9日 GMT-4 22:50
Hi.

I am facing the exact same problem as Stefanos. When I try to integrate the number of particles over a selected surface, I get the 'failed to evaluate variable' error. My model file can be found here www.mediafire.com/?q6twua5qiu5pg9t. Any help in this regard would be greatly appreciated.

Thanks
Ashish
Hi. I am facing the exact same problem as Stefanos. When I try to integrate the number of particles over a selected surface, I get the 'failed to evaluate variable' error. My model file can be found here http://www.mediafire.com/?q6twua5qiu5pg9t. Any help in this regard would be greatly appreciated. Thanks Ashish

Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年10月10日 GMT-4 03:41
Hi,

The variable cpt.Nsel contains the total number of particles in a selection (of domains), so use a Global Evaluation node under Derived Values to evaluate cpt.Nsel for a Particle data set (no integration is needed). If you want the particles in a specific domain instead of the entire geometry, add a Selection subnode to the Particle data set and use it to restrict the partuicle data to the domains selected in the settings for the Selection subnode.

Best regards,
Magnus Ringh, COMSOL
Hi, The variable cpt.Nsel contains the total number of particles in a selection (of domains), so use a Global Evaluation node under Derived Values to evaluate cpt.Nsel for a Particle data set (no integration is needed). If you want the particles in a specific domain instead of the entire geometry, add a Selection subnode to the Particle data set and use it to restrict the partuicle data to the domains selected in the settings for the Selection subnode. Best regards, Magnus Ringh, COMSOL

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年10月23日 GMT-4 15:50
Yes indeed it is - A guessing game on particle counting
-------------------------------------------------------------------------
www.avl.com/particle-counter - en.wikipedia.org/wiki/Particle_counter - www.comsol.com/video/
Yes indeed it is - A guessing game on particle counting ------------------------------------------------------------------------- https://www.avl.com/particle-counter - http://en.wikipedia.org/wiki/Particle_counter - http://www.comsol.com/video/

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年2月7日 GMT-5 06:25
Yah we can find the total number of particles using Derived values > Global Evaluation. But if we want to plot how the number of particles sticking on a surface(boundary) are varying along the surface, then how do we do it?

Global evaluation is giving only time selection as parameter.


Hi,

The variable cpt.Nsel contains the total number of particles in a selection (of domains), so use a Global Evaluation node under Derived Values to evaluate cpt.Nsel for a Particle data set (no integration is needed). If you want the particles in a specific domain instead of the entire geometry, add a Selection subnode to the Particle data set and use it to restrict the partuicle data to the domains selected in the settings for the Selection subnode.

Best regards,
Magnus Ringh, COMSOL


Yah we can find the total number of particles using Derived values > Global Evaluation. But if we want to plot how the number of particles sticking on a surface(boundary) are varying along the surface, then how do we do it? Global evaluation is giving only time selection as parameter. [QUOTE] Hi, The variable cpt.Nsel contains the total number of particles in a selection (of domains), so use a Global Evaluation node under Derived Values to evaluate cpt.Nsel for a Particle data set (no integration is needed). If you want the particles in a specific domain instead of the entire geometry, add a Selection subnode to the Particle data set and use it to restrict the partuicle data to the domains selected in the settings for the Selection subnode. Best regards, Magnus Ringh, COMSOL [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年6月26日 GMT-4 11:53
Has anyone found a good way to quantify the particles passing a boundary?

I am using the mathematical particle tracing module with the Hamiltonian analogy to simulate optical ray tracing. I want to be able to quantify the distribution of rays that reach specific boundaries in 2D and/or a surface in 3D.

Any help would be greatly appreciated. Thanks!

-NC
Has anyone found a good way to quantify the particles passing a boundary? I am using the mathematical particle tracing module with the Hamiltonian analogy to simulate optical ray tracing. I want to be able to quantify the distribution of rays that reach specific boundaries in 2D and/or a surface in 3D. Any help would be greatly appreciated. Thanks! -NC

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 2015年5月21日 GMT-4 19:12
Hi,

I have the same question. I could not find a way to (automatically) count the particle number passing a boundary, though manually count is OK. But what if when there is a huge bunch of particles...

Thanks in advance for anyone who knows the answer.
Hi, I have the same question. I could not find a way to (automatically) count the particle number passing a boundary, though manually count is OK. But what if when there is a huge bunch of particles... Thanks in advance for anyone who knows the answer.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年6月1日 GMT-4 00:46
Hi,
I have the same question as well!!!
did you find any answer?
would you please help me?

thanks
Hi, I have the same question as well!!! did you find any answer? would you please help me? thanks

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年7月6日 GMT-4 11:39
Hi,

I haven't got a solution yet, but I found this post:

www.comsol.com/community/forums/general/thread/34641/

Probably we should use the LiveLink for Matlab... I am going to study this.

Jingyuan
Hi, I haven't got a solution yet, but I found this post: http://www.comsol.com/community/forums/general/thread/34641/ Probably we should use the LiveLink for Matlab... I am going to study this. Jingyuan

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年7月9日 GMT-4 22:19
I just figured this out. You should refer to Magnus's answer above, really helpful. Pay attention:
1) The subnode should be under the "Derived Values" node
2) Add a "Global Evaluation" subnode instead of "Particle Evaluation" subnode.
I just figured this out. You should refer to Magnus's answer above, really helpful. Pay attention: 1) The subnode should be under the "Derived Values" node 2) Add a "Global Evaluation" subnode instead of "Particle Evaluation" subnode.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年7月26日 GMT-4 18:15
Hi, I added the node as you suggested, may I know where to get the solution to the particle number? Thank you!
Hi, I added the node as you suggested, may I know where to get the solution to the particle number? Thank you!

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年7月28日 GMT-4 12:29
Hi,
Under the "Global Evaluation" node, select "particle1" for "Data Set". You need also to add the "fpt.Nsel" under "expression".
Hi, Under the "Global Evaluation" node, select "particle1" for "Data Set". You need also to add the "fpt.Nsel" under "expression".

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年7月28日 GMT-4 17:26
Thank you! I did the setting but where I can see the results after computing please?
Also, if I want to count the particle number in a specific region or passing through specific cutting surface, may I know how to do the setting? thanks for the time!
Thank you! I did the setting but where I can see the results after computing please? Also, if I want to count the particle number in a specific region or passing through specific cutting surface, may I know how to do the setting? thanks for the time!

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年7月29日 GMT-4 13:26
You can see the no. of particles on the bottom right frame. It will show the result if you click "Evaluate". If you could not see it, try to change the tag of the bottom right frame to "Table 1".

This is basically how to calculate the no. of particles in a chosen boundary. If you want to know the no. of particles in a specific boundary, just choose it. There is also a "time selection" in your "Global evaluation" settings. This indicate the total no. of particles passing your selected boundary from the beginning to your selected time.
You can see the no. of particles on the bottom right frame. It will show the result if you click "Evaluate". If you could not see it, try to change the tag of the bottom right frame to "Table 1". This is basically how to calculate the no. of particles in a chosen boundary. If you want to know the no. of particles in a specific boundary, just choose it. There is also a "time selection" in your "Global evaluation" settings. This indicate the total no. of particles passing your selected boundary from the beginning to your selected time.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年7月31日 GMT-4 11:32
hi, thank you so much for kind reply. I can get the total particle number in the area now. But it seems I can not select any boundaries. I tried to go to "outlet" node, in which window it allows me to select boundaries. then go back to "global evaluation", and select one boundary, but the evaluation still gives me the total number (attached Figure). May I know how to solve it please? so appreciate your help!
hi, thank you so much for kind reply. I can get the total particle number in the area now. But it seems I can not select any boundaries. I tried to go to "outlet" node, in which window it allows me to select boundaries. then go back to "global evaluation", and select one boundary, but the evaluation still gives me the total number (attached Figure). May I know how to solve it please? so appreciate your help!


Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年8月1日 GMT-4 14:10
Hi,

Please make sure to have this "selection" node under "particles", and choose the boundary you want (see attached file). I believe that is the reason why you only have the total no. of particles.
Hi, Please make sure to have this "selection" node under "particles", and choose the boundary you want (see attached file). I believe that is the reason why you only have the total no. of particles.


Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年8月1日 GMT-4 17:12
Hi, Jingyuan, thank you so much for the instruction, I finally get the results! Have a nice weekend!
Hi, Jingyuan, thank you so much for the instruction, I finally get the results! Have a nice weekend!

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年8月12日 GMT-4 10:06
Hi,
I'm doing something similar only for a ray trace simulation. How do I count the number of rays in a particular wall?
Hi, I'm doing something similar only for a ray trace simulation. How do I count the number of rays in a particular wall?


Daniel Smith COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年11月19日 GMT-5 11:02
A blog post on counting particles is now available:
www.comsol.com/blogs/different-ways-to-count-particles-in-comsol-multiphysics/
A blog post on counting particles is now available: http://www.comsol.com/blogs/different-ways-to-count-particles-in-comsol-multiphysics/

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年8月11日 GMT-4 14:47
How do you count it manually? from particle trajectories ?
How do you count it manually? from particle trajectories ?

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年8月11日 GMT-4 14:50
You don't need to count manually. The software can automatically count the number. Just follow the options written in the post above.
You don't need to count manually. The software can automatically count the number. Just follow the options written in the post above.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.