CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   particle tracking using MPPICFoam (https://www.cfd-online.com/Forums/openfoam/197601-particle-tracking-using-mppicfoam.html)

TurbJet January 10, 2018 14:12

particle tracking using MPPICFoam
 
Hello everyone,

Currently I am trying to use MPPICFoam to track particles and delete them when they enter certain area. However, I have difficulty finding the codes about where the positions of these particles are stored nor the function of deleting the particles. I tried to read MPPICFoam, KinematicCloud, MPPICCloud flies, but I got nothing. So I hope someone can help me out here.

Thanks a lot.:)

farzadmech November 18, 2019 11:04

Hey,
did you find an answer for your question?

dscian November 18, 2019 16:20

You will find that part of the code in $FOAM_SRC/lagrangian/basic/Cloud/Cloud.C

On the other hand particleCollector function object would solve your problem. You have to add it in your kinematicCloudProperties file.

farzadmech November 18, 2019 17:02

Dear dscian
Thanks for you answer, but what I am looking for is to find the Y position of particles(bubbles) and put it in below code;

const KinematicParcel<ParcelType>& p;


//Increase in diameter due to rising of bubble using ideal gas relation P1*V1=P2*V2 ===> V2 = (P1*V1)/P2
scalar V0 =Vinit*(Patm+(Ymax - 0.)*rhoo*gg) / (Patm+(Ymax - p.position()[2])*rhoo*gg);

When I do this, I have got an error which says that the initialization has not done correctly, what should I do?

dscian November 19, 2019 21:12

You can use p.position().y() to get that scalar value however the initialization of p is incorrect. You have to link it to your Cloud and use a for loop with an iterator. Something like this (i.e in Cloud.C);


Code:

forAllIter(typename Cloud<ParticleType>, *this, pIter)
{
      ParticleType& p = pIter();
...
}

If you need it in Cloud templates then check those codes for reference.


All times are GMT -4. The time now is 03:34.