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

Overlap detector for injected parcels

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 14, 2022, 21:16
Default Overlap detector for injected parcels
  #1
New Member
 
Yves Robert
Join Date: May 2019
Posts: 4
Rep Power: 7
yv3s95 is on a distinguished road
Hello,

I would like to use an overlap detector for injected parcels in a momentum cloud for particleFoam. I think this would be a valuable addition to the DEM solver, since it does not check for overlap, resulting in freezing of the code.

To do that, I want to modify the following function:
src/lagrangian/parcel/submodels/Momentum/InjectionModel/InjectionModel/InjectionModel.C

Basically, I wrote in that file a new function that takes two parcel pointers p1 and p2 and determines the two particles are overlapping.

What I would like is now to test if, when I inject a parcel, this parcel overlaps with an already existing parcel. I am open to any ideas as of how to implement that, since I am a new OpenFOAM developer.

My example is the one of a cylinder which is open at the top from which we insert buoyant parcels from the bottom patch and which move upwards and can leave the cylinder once they reach the top.

For now, what I tried to do is to create an empty DynamicList of parcels, and go through the owner of the injector (the parcels cloud) and iterate over all parcels p. If the parcel's position is low enough (z<Zmin), I will have to look if there is a collision between the injected parcels and p. Therefore, I add the parcel p to the DynamicList.

Then, when the injection happens (when the position of the parcel is sampled), I go through the elements of the DynamicList and test for collision with the injected parcel.

At least that is the idea.
The problem is that my limited knowledge makes it very hard for me to apply.

What I did was to create an empty DynamicList in the momentumCloud function so that I can populate it during the calculation and store the information through all injectors. Then Ï would to apply my idea and add something like that in the "inject" function:


Code:
forAll(this->owner().parcels_of_interest_, i)
{
    if (collision_test(*this->owner().parcels_of_interest_[i], *pPtr))
    {
        injection_ok = false;
        break;
    }
}
The problem is that it fails. The error shows that the "position()" attribute is not found in this->owner().parcels_of_interest_[i]. Indeed, if I try to print what is *this->owner().parcels_of_interest_[i]->position(), it crashes.

I am open to any suggestion, and modifications of my code.

Thank you!
yv3s95 is offline   Reply With Quote

Reply


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
kinematic cloud properties-Regd thegauravonline OpenFOAM Programming & Development 11 August 8, 2023 06:52
limit diameter of parcels in sprayFoam Rid@foam OpenFOAM 0 March 25, 2021 04:47
More parcels stuck than there have been in the system tomf OpenFOAM Running, Solving & CFD 1 April 30, 2019 07:11
Inconsistencies in reading .dat file during run time in new injection model Scram_1 OpenFOAM 0 March 23, 2018 23:29
Unfinished particle tracks in simpleReactingParcelFoam Cornelia OpenFOAM Running, Solving & CFD 3 June 5, 2015 04:58


All times are GMT -4. The time now is 00:06.