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

Access trackingData in PairCollision

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By oswald
  • 1 Post By oswald

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 17, 2020, 13:41
Default Access trackingData in PairCollision
  #1
New Member
 
Kaazem
Join Date: Jul 2018
Posts: 14
Rep Power: 8
Kaazem_RA is on a distinguished road
Hi everyone
I am working on Lagrangian particle tracking in openfoam. I want to add some pieces of code in PairCollision class. In this class there are some functions in which particle-particle and particle-wall interactions are evaluated. wallInteraction() is the function in which i want to add some pieces of code. In this function there is a loop over all parcels in cell which some part of it is as follows:
Code:
forAll(cellOccupancy[realCelli], cellParticleI)
        {
            flatSitePoints.clear();
            flatSiteExclusionDistancesSqr.clear();
            flatSiteData.clear();
            otherSitePoints.clear();
            otherSiteDistances.clear();
            otherSiteData.clear();
            sharpSitePoints.clear();
            sharpSiteExclusionDistancesSqr.clear();
            sharpSiteData.clear();

            typename CloudType :: parcelType& p = *cellOccupancy[realCelli][cellParticleI];
a parceltype p is defined. Is it possible to access trackingData of this parcelType. I would like to assigin keepParticle to false to delete the parcel. I have tried some code like
p::trackingData& td or parcelType::trackingData& td but i encounter error after compilation. It would be highly appreciated if anyone could help.
Kaazem_RA is offline   Reply With Quote

Old   October 22, 2020, 04:23
Default
  #2
Member
 
Join Date: Sep 2010
Location: Leipzig, Germany
Posts: 96
Rep Power: 16
oswald is on a distinguished road
Hi,


I assume that you would have to hand it over to the function in which you want to use it (see for example the "update"-funciton in StochasticCollisionModel.C) or you would have to put it in the class-constructor to have it available in the whole PairCollision-class.
Kaazem_RA likes this.
oswald is offline   Reply With Quote

Old   October 22, 2020, 11:18
Default
  #3
New Member
 
Kaazem
Join Date: Jul 2018
Posts: 14
Rep Power: 8
Kaazem_RA is on a distinguished road
Quote:
Originally Posted by oswald View Post
Hi,


I assume that you would have to hand it over to the function in which you want to use it (see for example the "update"-funciton in StochasticCollisionModel.C) or you would have to put it in the class-constructor to have it available in the whole PairCollision-class.
Thank you very much for your reply. I have realized that a function exists in openfoam that remove particle: deleteParticle(p). I use this function in PairCollision class as below:
Code:
 this->owner().deleteParticle(p)
after adding this line my new intermediate library compiled successfully. Now i encounter a new problem. None of member functions of PairCollision class is called. I expected them to be called in collidingCloud class using line below
Code:
collsionModel().collide()
I use Info to check collide() function call but nothing appears on terminal when running hopper tutorial case. It woud be greatly appreciated if you could help.
Best regarad,
Kazem
Kaazem_RA is offline   Reply With Quote

Old   October 23, 2020, 07:19
Default
  #4
Member
 
Join Date: Sep 2010
Location: Leipzig, Germany
Posts: 96
Rep Power: 16
oswald is on a distinguished road
Hi Kazem,


where and why are you calling this function? It would be easier to give some advise if there would be a bit more information, especially a bit more of the code you were writing.
Kaazem_RA likes this.
oswald is offline   Reply With Quote

Old   October 23, 2020, 13:01
Default
  #5
New Member
 
Kaazem
Join Date: Jul 2018
Posts: 14
Rep Power: 8
Kaazem_RA is on a distinguished road
Thank you very much for your reply oswald. Actually i have discovered that in of6 and later versions all particles are considered as points and there is no function to control particle-wall distance unless pair collision model is turned on. I am trying to solve flow and particle in a geometry in which when a particle hits a wall it sticks to it. Hopefully In pair collision class there exist a function wallInteraction() in which a loop over all parcels exists and it controls the distance between particle and wall. If the distance between particle and wall is lower than half of the particle diameter particle-wall interaction is evaluated. In this function i add deleteParticle(p) to remove the particle. I think this is the easiest way to do that. Today i use Info in collide() function in which wallInteraction() is also called to check function call. This time i use of7 instead of of6. Unlike of6 i did not encounter any problem and my message appeared on the terminal. I really don't have any idea why nothing appears on the terminal when i use of6.

Last edited by Kaazem_RA; October 23, 2020 at 15:57.
Kaazem_RA is offline   Reply With Quote

Old   October 23, 2020, 16:04
Default
  #6
Member
 
Join Date: Sep 2010
Location: Leipzig, Germany
Posts: 96
Rep Power: 16
oswald is on a distinguished road
Also before version 6 particles were treated as points, as this is the standard way in Euler-Lagrange-methods. Otherwise there would for example be no need for force models.



Do I get you right that the only reason you are using the deterministic collision model is that you want particles that hit walls will stick to them? If so: Consider using "standardWallInteraction" with the option "stick" as patchInteractionModel. This drastically reduces the computational effort. If you want the particles to vanish and to to be kept inside the domain, use the option "escape" instead of "stick".


If you have any other reasons to use pairCollision: I still did not get what you are trying to achieve at the moment, sorry.
oswald is offline   Reply With Quote

Old   October 23, 2020, 19:56
Default
  #7
New Member
 
Kaazem
Join Date: Jul 2018
Posts: 14
Rep Power: 8
Kaazem_RA is on a distinguished road
Thank you very much for your answer.

You are completely right. For spherical particles using standardWallInteraction is a very good choice and reduces computational efforts.
The big problem i have is that i deal with non-spherical particles and as you probably know there is a completely different mechanism for non-spherical particles to stick to the wall they hit. I checked standardWallInteraction class and tried to add some pieces of code to account for non-spherical particle depositions but i could not. There is only one function correct() in this class which is called whenever a particle center touches the wall. This is not what i want. I need a function that controls the distance between the particle and the wall. To the best of my knowledge just wallInteraction() function has this capacity (It would be appreciated if you introduce any function if available).

In this function the distance between a particle and nearest wall is calculated. If this distance is lower than half diameter of the particle, wall-interaction is evaluated. For non-spherical particle the minimum distance is not half diameter and my goal is to add this distance to pairCollision class and then remove particle if the aforementioned distance is lower than nearest wall distance.

Last edited by Kaazem_RA; October 24, 2020 at 07:14.
Kaazem_RA is offline   Reply With Quote

Old   November 4, 2020, 04:33
Default
  #8
Member
 
Join Date: Sep 2010
Location: Leipzig, Germany
Posts: 96
Rep Power: 16
oswald is on a distinguished road
I see, with non-spherical particles it is a bit more complicated. Maybe the wall distance stuff is of interest for you? https://www.openfoam.com/documentati...-distance.html


You can find an example in applications/test/wallDist
oswald is offline   Reply With Quote

Old   November 5, 2020, 15:49
Default
  #9
New Member
 
Kaazem
Join Date: Jul 2018
Posts: 14
Rep Power: 8
Kaazem_RA is on a distinguished road
thank you very much for your answer. I will check the link.
Kaazem_RA is offline   Reply With Quote

Old   May 22, 2024, 11:38
Default
  #10
New Member
 
Richard Tribess
Join Date: Jul 2021
Posts: 8
Rep Power: 5
richardt is on a distinguished road
Greetings, Kaazem

Have you managed to solve your problem for non-spherical particle deposition using the wallInteraction() function?

I have implemented something with the wallDistance function in order to consider the real particle size when using a patchInteractionModel, however, I am limited to particle radius values smaller than the wall boundary cell height.

Also, have you used AMR with the "collisionModel pairCollision" on?

Thank you in advance.
richardt is offline   Reply With Quote

Old   May 23, 2024, 03:29
Default
  #11
New Member
 
Kaazem
Join Date: Jul 2018
Posts: 14
Rep Power: 8
Kaazem_RA is on a distinguished road
Hi richardt
Yes I managed to solve the problem. I defined a function that takes tracking data as input as following:
virtual void ellipsoidalFiberCollide
(
typename CloudType:: parcelType:: trackingData& td

);
Kaazem_RA is offline   Reply With Quote

Reply

Tags
collision, lagrangian openfoam


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
Getting access to mesh (fvMesh) via object registry Chris Lucas OpenFOAM Programming & Development 18 January 15, 2024 03:57
[DesignModeler] DesignModeler Scripting: How to get Full Command Access ANT ANSYS Meshing & Geometry 53 February 16, 2020 16:13
Why is access to turbulence fields provided as const? mrishi OpenFOAM Programming & Development 3 January 23, 2020 13:51
Is there a way to access the gradient limiter in Fluent ? CFDYourself FLUENT 1 February 16, 2016 06:49
Online libraries - with access to Journals momentum_waves Main CFD Forum 2 December 12, 2007 11:08


All times are GMT -4. The time now is 07:40.