CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   remove particle (https://www.cfd-online.com/Forums/openfoam-programming-development/162628-remove-particle.html)

nimasam November 14, 2015 15:44

remove particle
 
im going to implement a function in icoLagrangianFoam, and i use basicKinematicCloud, i want to delete a particle from specific zone in computational domain. for now i can return access to particle and mark it, but i dont know how to remove it.

deleteParticle or move functions are a part of Cloud class, i can not understand how i can access to Cloud.H from basicKinematicCloud object?

nimasam November 15, 2015 05:42

i continue this post, it can be achieve with following piece of code:
Quote:

kinematicCloud.deleteParticle(p);
but after it deletes the first particle, it error in second one, the error line is:
Quote:

#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigSegv::sigHandler(int) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::DLListBase::remove(Foam::DLListBase::link*) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4
in "/home/nimasam/OpenFOAM/nimasam-2.2.0/platforms/linuxGccDPOpt/bin/icoLagrangianFoam"
#5 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#6
in "/home/nimasam/OpenFOAM/nimasam-2.2.0/platforms/linuxGccDPOpt/bin/icoLagrangianFoam"
Segmentation fault (core dumped)

nimasam November 15, 2015 13:18

the problem solved :)

aghsin September 5, 2016 07:15

delete particle
 
Quote:

Originally Posted by nimasam (Post 573367)
i continue this post, it can be achieve with following piece of code:

but after it deletes the first particle, it error in second one, the error line is:

Hi Nima,
would you please explain how did you managed to solve the problem?

nimasam September 30, 2016 13:43

following syntax:
Code:

typedef typename Foam::KinematicParcel<Foam::particle> parcelType ;

forAllIter( basicNewKinematicCloud , kinematicCloud, iter)
{
    parcelType& p = iter(); //paticle
  kinematicCloud.deleteParticle(p);
}


ywj March 27, 2020 21:10

hi, could you please tell me where you write those codes?

nimasam March 28, 2020 19:41

you can add it to your Lagrangian solver and recompile the solver


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