CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How many particles are in a cell?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 21, 2021, 04:27
Default How many particles are in a cell?
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 787
Rep Power: 14
sharonyue is on a distinguished road
Hello there,

I know that p.cell() tells you that which cell this particle belongs to. On the contrary, I want to know the particles' label if they belong to a same cell. I tried some ways but they are cumbersome. Is there any simple way to achieve this?

Thanks.

In the following it is an example, we have 5 particles labeling 1,2,3,4,5.
particle 1 belongs to cell 23
particle 2 belongs to cell 20
particle 3 belongs to cell 23
particle 4 belongs to cell 21
particle 5 belongs to cell 23
therefore, cell 23 has particle 1 3 5. How can we extract the labels "1" "3" "5"?
__________________
My OpenFOAM algorithm website: http://dyfluid.com
By far the largest Chinese CFD-based forum: http://www.cfd-china.com/category/6/openfoam
By far the largest WECHAT CFD media ID: cfdresearch
sharonyue is offline   Reply With Quote

Old   October 21, 2021, 06:40
Default
  #2
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 97
Rep Power: 13
guin is on a distinguished road
You seem to be actually looking for what cellOccupancy() does

https://cpp.openfoam.org/v7/classFoa...bcb51500c11841

I am not sure if it will give you with the appropriate output format out of the box, but you can try it out.
guin is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
F 32 number of particles per cell ananthw REEF3D 1 June 16, 2021 06:13
Fluent UDF wrong number of cells in parallel - correct in serial dralexpe Fluent UDF and Scheme Programming 7 May 17, 2018 09:26
Add lagrangian particles to OpenFoam solver luchen2408 OpenFOAM 0 June 2, 2015 04:10
trying to simulate two-phase jet flow with particles in surface injection ajkratos FLUENT 5 March 3, 2015 22:33
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 15:06


All times are GMT -4. The time now is 19:46.