CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Multiphase Solid Particle Tracking (http://www.cfd-online.com/Forums/openfoam-solving/117375-multiphase-solid-particle-tracking.html)

alexlupo May 7, 2013 10:05

Multiphase Solid Particle Tracking
 
Hi,

After some time trying I finally compiled a new solver for particle tracking in interFoam and set up a case but when I try to run the case it seems that, at some point, it gets stuck in an infinite loop. I tracked in the .C file where the problem is and it shows that it is in the piece of code particles.move(g); and in the second iteration. The first iteration runs ok.
Any suggestions would be appreciated!
Thanks a lot in advance!

Alex

alexlupo May 7, 2013 11:27

Solved
 
Hi again!
I just solved the issue. It didn't get through the second iteration because tetFaceI and tetPtI were not properly initialised!
Cheers anyway!
P.S.:If someone wants to discuss such a solver in order to improve it, comments are welcome!!

ovie September 6, 2013 14:47

Quote:

Originally Posted by alexlupo (Post 425883)
Hi again!
I just solved the issue. It didn't get through the second iteration because tetFaceI and tetPtI were not properly initialised!
Cheers anyway!
P.S.:If someone wants to discuss such a solver in order to improve it, comments are welcome!!

Hi:

I am trying to combine interFoam with lagrangian particle tracking (2 or 4 way coupling). Could you please share some insight into how you developed your solver? Have you been able to validate results from the solver?

Thanks.

alexlupo September 6, 2013 16:26

Quote:

Originally Posted by ovie (Post 450261)
Hi:

I am trying to combine interFoam with lagrangian particle tracking (2 or 4 way coupling). Could you please share some insight into how you developed your solver? Have you been able to validate results from the solver?

Thanks.

Hi there!
I havent been able to validate because I am working now on the same kind of solver but with pimpleFoam.
Anyway, as a starting point, there is a very good tutorial on how to couple both interFoam and the solidParticle class:
http://www.tfd.chalmers.se/~hani/kur...LPT_120911.pdf
The tutorial is for a previous version of OpenFoam so you will have to upgrade it in case you are using 2.2.x.
Take a look and just let me know if you need some help. I will be glad to help you.
Cheers,

ovie September 6, 2013 18:33

Quote:

Originally Posted by alexlupo (Post 450277)
Hi there!
I havent been able to validate because I am working now on the same kind of solver but with pimpleFoam.
Anyway, as a starting point, there is a very good tutorial on how to couple both interFoam and the solidParticle class:
http://www.tfd.chalmers.se/~hani/kur...LPT_120911.pdf
The tutorial is for a previous version of OpenFoam so you will have to upgrade it in case you are using 2.2.x.
Take a look and just let me know if you need some help. I will be glad to help you.
Cheers,

Hi:

Thanks for the information. I actually have a copy of the Chalmers slides with me and I have been using it as guide to develop my solver. And yes, the tutorial in the pdf is for an older OF version. But I think the new Lagrangian implementation makes it easier to do particle tracking in an existing fluid solver.

My main worry is how to deal with issues relating to particles migrating from one phase (say liquid) into another. I have not run any such simulations so I dont know if this is something that is likely to occur in the first place. I was just wondering if this is something you have thought of as well and could provide some ideas on how to design the solver to prevent such migration.

Thanks for sharing your thoughts.

alexlupo September 7, 2013 15:10

Quote:

Originally Posted by ovie (Post 450287)
Hi:

Thanks for the information. I actually have a copy of the Chalmers slides with me and I have been using it as guide to develop my solver. And yes, the tutorial in the pdf is for an older OF version. But I think the new Lagrangian implementation makes it easier to do particle tracking in an existing fluid solver.

My main worry is how to deal with issues relating to particles migrating from one phase (say liquid) into another. I have not run any such simulations so I dont know if this is something that is likely to occur in the first place. I was just wondering if this is something you have thought of as well and could provide some ideas on how to design the solver to prevent such migration.

Thanks for sharing your thoughts.

I am not sure if I understood your question properly, but the solidParticle class should not give any problems relating phase migration. The issues you can experience (and by the way that I am experiencing) are related to the particles going out of the boundaries, thus showing unexpected behavior, or simulations crashing in parallel due to the injection of particles in more than one processor boundary.
If your question is related to particles moving from one phase to another, I guess that could eventually happen, but from my point of view that could also have a physical explanation, taking into account the difference of density between both particles and fluids.
I guess if both phases are clearly separated, you could just create a boundary in between so that you would not allow the particles to move from phase to the other.
Let me know if this was what you intend to do and if not, could you explain it further?
Cheers,

nero235 September 10, 2013 05:49

Quote:

Originally Posted by alexlupo (Post 425883)
Hi again!
I just solved the issue. It didn't get through the second iteration because tetFaceI and tetPtI were not properly initialised!
Cheers anyway!
P.S.:If someone wants to discuss such a solver in order to improve it, comments are welcome!!

Hello alexlupo,

how did you define these two variables: tetFaceI, tetPtI? I am stuck right here, because the tutorial from Aurelia Vallier doesn't include how to define these two. My inject function looks like this right now:

Code:

void Foam::solidParticleCloud::inject(solidParticle::trackingData &td)
{
    label cellI=mesh_.findCell(td.spc().posP1_);        // primitiveMesh::findCell()
    //label tetFaceI=mesh_.findCellFacePt(td.spc().posP1_, ?);
    //label tetPtI=mesh_.findCellFacePt(td.spc().posP1_, ? );
    label tetPtI=mesh_.findCellFacePt(td.spc().posP1_,cellI,tetFaceI,tetPtI);

    solidParticle* ptr1=new solidParticle(*this,td.spc().posP1_,cellI,tetFaceI,tetPtI,td.spc().dP1_,td.spc().UP1_);
    Cloud<solidParticle>::addParticle(ptr1);

    label cellI=mesh_.findCell(td.spc().posP2_);        // primitiveMesh::findCell()
    //label tetFaceI=mesh_.findCellFacePt(td.spc().posP2_, ? );
    //label tetPtI=mesh_.findCellFacePt(td.spc().posP2_, ? );
    label tetPtI=mesh_.findCellFacePt(td.spc().posP2_,cellI,tetFaceI,tetPtI);

    solidParticle* ptr2=new solidParticle(*this,td.spc().posP2_,cellI,tetFaceI,tetPtI,td.spc().dP2_,td.spc().UP2_);
    Cloud<solidParticle>::addParticle(ptr2);
}

I would be glad for some insight on how to define:
Code:

label tetFaceI
and
Code:

label tetPtI
Thanks for your help!

Greetings, Sebastian.

alexlupo September 11, 2013 13:00

Hello Sebastian,

First of all, what you do with that first part of the code, if I remember well, is to tell OpenFoam to search for the cell, the tetFaceI and the tetPtI in the position of the point you defined you injector is going to be.
If you look in Doxygen for findCellFacePt you will get a definition of what I just said.
So, basically this function
Code:

mesh_.findCellFacePt()
takes a point as an argument and it returns three labels, which will be the cell, the tetFaceI and the tetPtI.
For this to work properly, it is better to initialize first those variables you are going to use and then just write them inside the function so that the values that it returns are stored in those variables you created. For example:
Code:

label cellI=1;
label tetFaceI=1;
label tetPtI=1;
mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI);

Now the values in those cellI tetFaceI and tetPtI are the ones you need to inject the particles at the point you defined.
Finally, for the code to work properly (if you are using newer versions of OpenFOAM than the one Aurelia used) you should change the
Code:

td.spc().
for
Code:

td.cloud().
because that spc will not be recognized in the new code.
Hope this helps you!
Cheers,
Alex

Quote:

Originally Posted by nero235 (Post 450877)
Hello alexlupo,

how did you define these two variables: tetFaceI, tetPtI? I am stuck right here, because the tutorial from Aurelia Vallier doesn't include how to define these two. My inject function looks like this right now:

Code:

void Foam::solidParticleCloud::inject(solidParticle::trackingData &td)
{
    label cellI=mesh_.findCell(td.spc().posP1_);        // primitiveMesh::findCell()
    //label tetFaceI=mesh_.findCellFacePt(td.spc().posP1_, ?);
    //label tetPtI=mesh_.findCellFacePt(td.spc().posP1_, ? );
    label tetPtI=mesh_.findCellFacePt(td.spc().posP1_,cellI,tetFaceI,tetPtI);

    solidParticle* ptr1=new solidParticle(*this,td.spc().posP1_,cellI,tetFaceI,tetPtI,td.spc().dP1_,td.spc().UP1_);
    Cloud<solidParticle>::addParticle(ptr1);

    label cellI=mesh_.findCell(td.spc().posP2_);        // primitiveMesh::findCell()
    //label tetFaceI=mesh_.findCellFacePt(td.spc().posP2_, ? );
    //label tetPtI=mesh_.findCellFacePt(td.spc().posP2_, ? );
    label tetPtI=mesh_.findCellFacePt(td.spc().posP2_,cellI,tetFaceI,tetPtI);

    solidParticle* ptr2=new solidParticle(*this,td.spc().posP2_,cellI,tetFaceI,tetPtI,td.spc().dP2_,td.spc().UP2_);
    Cloud<solidParticle>::addParticle(ptr2);
}

I would be glad for some insight on how to define:
Code:

label tetFaceI
and
Code:

label tetPtI
Thanks for your help!

Greetings, Sebastian.


nero235 September 16, 2013 11:16

Quote:

Originally Posted by alexlupo (Post 451181)
Hello Sebastian,

First of all, what you do with that first part of the code, if I remember well, is to tell OpenFoam to search for the cell, the tetFaceI and the tetPtI in the position of the point you defined you injector is going to be.
If you look in Doxygen for findCellFacePt you will get a definition of what I just said.
So, basically this function
Code:

mesh_.findCellFacePt()
takes a point as an argument and it returns three labels, which will be the cell, the tetFaceI and the tetPtI.
For this to work properly, it is better to initialize first those variables you are going to use and then just write them inside the function so that the values that it returns are stored in those variables you created. For example:
Code:

label cellI=1;
label tetFaceI=1;
label tetPtI=1;
mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI);

Now the values in those cellI tetFaceI and tetPtI are the ones you need to inject the particles at the point you defined.
Finally, for the code to work properly (if you are using newer versions of OpenFOAM than the one Aurelia used) you should change the
Code:

td.spc().
for
Code:

td.cloud().
because that spc will not be recognized in the new code.
Hope this helps you!
Cheers,
Alex

Hello Alex,

thank you for your help! I will try this as soon I have some time for it :). However I found another way to couple interfoam with a lagrangian particle tracking method, which is by including swak4Foam libraries into your controlDict.

Thanks for the help!

Greetings, Sebastian

scram March 3, 2014 11:22

Hallo Foamers,

Does anyone know the coupling algorithm of "LPTtoVOF.H" by Vallier form this presentation:

http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2011/OF_kurs_LPT_120911.pdf

or has an idea where to find it? I can't find any publication on this

thank you
Stefan

nero235 March 3, 2014 11:55

Quote:

Originally Posted by scram (Post 477762)
Hallo Foamers,

Does anyone know the coupling algorithm of "LPTtoVOF.H" by Vallier form this presentation:

http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2011/OF_kurs_LPT_120911.pdf

or has an idea where to find it? I can't find any publication on this

thank you
Stefan


Hello Stefan,

I am not sure if the any code was published but Ms. Vallier, but she describes in the presentation pretty good on how to couple LPT methods with interFoam. I tried it myself until I found a better solution. Also the tutorial uses a very old OpenFOAM version (1.6.x or 1.7.x). Therefor the coupling is different when using 2.3.x for example. A better way to integrate LPT into any OpenFOAM solver is by using swak4Foam.

Hope this helps.

Sebastian

scram March 4, 2014 04:51

Quote:

Originally Posted by nero235 (Post 477770)
Hello Stefan,

I am not sure if the any code was published but Ms. Vallier, but she describes in the presentation pretty good on how to couple LPT methods with interFoam. I tried it myself until I found a better solution. Also the tutorial uses a very old OpenFOAM version (1.6.x or 1.7.x). Therefor the coupling is different when using 2.3.x for example. A better way to integrate LPT into any OpenFOAM solver is by using swak4Foam.

Hope this helps.

Sebastian


Hello Sebastian,

thanks for the reply. i absolutly agree with you. She discribed the including of the "solidParticle" lib very good, and the solver is runnig (by the way, your upper hints where very helpful, thank you for that!). But i guess the key algorithm, which switches from LPT to VOF is implemented in this "LPTtoVOF.H" and not discribed in the presentation. Is swak4Foam able to remove lagrangian particles and add there mass/momentum/volume to the alpha fraction of the VOF methode?

nero235 March 4, 2014 10:07

Quote:

Originally Posted by scram (Post 477872)
Hello Sebastian,

thanks for the reply. i absolutly agree with you. She discribed the including of the "solidParticle" lib very good, and the solver is runnig (by the way, your upper hints where very helpful, thank you for that!). But i guess the key algorithm, which switches from LPT to VOF is implemented in this "LPTtoVOF.H" and not discribed in the presentation. Is swak4Foam able to remove lagrangian particles and add there mass/momentum/volume to the alpha fraction of the VOF methode?

Ok, what she does in "LPT to VOF" is that she injects a solid particle into the multiphase flow. To do that she couples the solver interFoam (VOF) with the solidParticle (Lagrange) library. This method is really handy and it has also a physical background. However this coupling can be done with swak4Foam also, without creating a new solver. Then she describes the different interaction types (1-way, 2-way, 4-way) and how to implement them into the LPTinterFoam.

However in this "LPTtoVOF" method she describes the modeling of a solid particle (Lagrange) which as soon it hits the phase interface becomes another fluid phase (VOF). This is physical non-sense however. Do you really need this feature? Normally a solid particle falling into a fluid interacts with the interface (creating waves resulting from the kinetic energy of the impact), it stays however solid.

What is your physical setup you want to simulate?

scram March 5, 2014 04:36

I'm trying to simulate breakup (atomization) and coalescence in small scales by using such a coupling of VOF and LPT in OF. Tomar et al. had already done implementaions like this in other codes:

3. Video (Lagrangian Particle Atomization Simulation - 5 Mbytes, click on image to view movie)

http://www.lmm.jussieu.fr/~zaleski/zaleski.html

> Link to "Animations"

correlated paper:

http://www.lmm.jussieu.fr/~zaleski/Papers/tomar-CAF.pdf

as a first step for this, i thought i just try Ms Valliers way to switch from LPT to VOF near the surface. That's why i'm searching for her algorithm in LTPtoVOF.H

willchennewcastle March 22, 2014 06:22

Quote:

Originally Posted by nero235 (Post 477987)
Ok, what she does in "LPT to VOF" is that she injects a solid particle into the multiphase flow. To do that she couples the solver interFoam (VOF) with the solidParticle (Lagrange) library. This method is really handy and it has also a physical background. However this coupling can be done with swak4Foam also, without creating a new solver. Then she describes the different interaction types (1-way, 2-way, 4-way) and how to implement them into the LPTinterFoam.

However in this "LPTtoVOF" method she describes the modeling of a solid particle (Lagrange) which as soon it hits the phase interface becomes another fluid phase (VOF). This is physical non-sense however. Do you really need this feature? Normally a solid particle falling into a fluid interacts with the interface (creating waves resulting from the kinetic energy of the impact), it stays however solid.

What is your physical setup you want to simulate?

It's certainly interesting about how to implement the Parcels in interFoam through SWAK. Could you please just share some thoughts on the procedure? My assumption is to use interFoam with swak4foam to set lagrangian particle field.

Mahdi2010 March 26, 2014 04:44

Actually you are right, as the solid particle impinges the fluid interface it
will cause splash and the physical change makes no sense. But, just imagine the
solid particles as representative particles. They are used only as some imaginary
data holder. you can add them and remove them whenever you need a continuous phase.
Also I agree with Stefan that the LPTtoVOF.H is not presented in her document and it is a key
part.

houwy April 23, 2014 08:07

Quote:

Originally Posted by alexlupo (Post 450277)
Hi there!
I havent been able to validate because I am working now on the same kind of solver but with pimpleFoam.
Anyway, as a starting point, there is a very good tutorial on how to couple both interFoam and the solidParticle class:
http://www.tfd.chalmers.se/~hani/kur...LPT_120911.pdf
The tutorial is for a previous version of OpenFoam so you will have to upgrade it in case you are using 2.2.x.
Take a look and just let me know if you need some help. I will be glad to help you.
Cheers,

I'm sorry to trouble you. I have coupled the inerFoam and solidParticleFoam in of2.2.0. But there are some problems when I add a particle injector. Can you tell me how to upgrade it.

houwy April 23, 2014 08:11

Quote:

Originally Posted by scram (Post 478182)
I'm trying to simulate breakup (atomization) and coalescence in small scales by using such a coupling of VOF and LPT in OF. Tomar et al. had already done implementaions like this in other codes:

3. Video (Lagrangian Particle Atomization Simulation - 5 Mbytes, click on image to view movie)

http://www.lmm.jussieu.fr/~zaleski/zaleski.html

> Link to "Animations"

correlated paper:

http://www.lmm.jussieu.fr/~zaleski/Papers/tomar-CAF.pdf

as a first step for this, i thought i just try Ms Valliers way to switch from LPT to VOF near the surface. That's why i'm searching for her algorithm in LTPtoVOF.H

Hi! Have you success to couple interfoam with solidParticle using Aurelia Vallier's method? I have some problem to do it on OF2.2.0. Can you give me some help?

Mahdi2010 April 24, 2014 01:19

Quote:

Originally Posted by houwy (Post 487700)
Hi! Have you success to couple interfoam with solidParticle using Aurelia Vallier's method? I have some problem to do it on OF2.2.0. Can you give me some help?

Please tell us more about your problem.

houwy April 24, 2014 02:41

Quote:

Originally Posted by alexlupo (Post 451181)
Hello Sebastian,

First of all, what you do with that first part of the code, if I remember well, is to tell OpenFoam to search for the cell, the tetFaceI and the tetPtI in the position of the point you defined you injector is going to be.
If you look in Doxygen for findCellFacePt you will get a definition of what I just said.
So, basically this function
Code:

mesh_.findCellFacePt()
takes a point as an argument and it returns three labels, which will be the cell, the tetFaceI and the tetPtI.
For this to work properly, it is better to initialize first those variables you are going to use and then just write them inside the function so that the values that it returns are stored in those variables you created. For example:
Code:

label cellI=1;
label tetFaceI=1;
label tetPtI=1;
mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI);

Now the values in those cellI tetFaceI and tetPtI are the ones you need to inject the particles at the point you defined.
Finally, for the code to work properly (if you are using newer versions of OpenFOAM than the one Aurelia used) you should change the
Code:

td.spc().
for
Code:

td.cloud().
because that spc will not be recognized in the new code.
Hope this helps you!
Cheers,
Alex

Hi! I still have some problem with it.
code:

Code:

void Foam::solidParticleCloud::inject(solidParticle::trackingData &td)
{
  label cellI = 1;
  label tetFaceI = 1;
  label tetPtI = 1;
  mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI);
  solidParticle* ptr1=new solidParticle(*this,td.cloud().posP1_,cellI,tetFaceI, tetPtI,
  td.cloud().dP1_,td.cloud().UP1_);
  Cloud<solidParticle>::addParticle(ptr1);
  mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI);
  solidParticle* ptr2=new solidParticle(*this,td.cloud().posP2_,cellI,tetFaceI, tetPtI,
  td.cloud().dP2_,td.cloud().UP2_);
  Cloud<solidParticle>::addParticle(ptr2);
}



when I compile it , There are still some errors.


Code:

solidParticleCloud.C: In member function ‘void Foam::solidParticleCloud::inject(Foam::solidParticle::trackingData&)’:
solidParticleCloud.C:81:34: error: no matching function for call to ‘Foam::solidParticle::solidParticle(Foam::solidParticleCloud&, Foam::vector&, Foam::label&, Foam::label&, Foam::label&, Foam::scalar&, Foam::vector&)’
solidParticleCloud.C:81:34: note: candidates are:
solidParticle.H:135:9: note: Foam::solidParticle::solidParticle(const Foam::polyMesh&, Foam::Istream&, bool)
solidParticle.H:135:9: note:  candidate expects 3 arguments, 7 provided
solidParticleI.H:47:8: note: Foam::solidParticle::solidParticle(const Foam::polyMesh&, const vector&, Foam::label, Foam::label, Foam::label, Foam::scalar, const vector&)
solidParticleI.H:47:8: note:  no known conversion for argument 1 from ‘Foam::solidParticleCloud’ to ‘const Foam::polyMesh&’
solidParticle.H:58:7: note: Foam::solidParticle::solidParticle(const Foam::solidParticle&)
solidParticle.H:58:7: note:  candidate expects 1 argument, 7 provided
solidParticleCloud.C:85:34: error: no matching function for call to ‘Foam::solidParticle::solidParticle(Foam::solidParticleCloud&, Foam::vector&, Foam::label&, Foam::label&, Foam::label&, Foam::scalar&, Foam::vector&)’
solidParticleCloud.C:85:34: note: candidates are:
solidParticle.H:135:9: note: Foam::solidParticle::solidParticle(const Foam::polyMesh&, Foam::Istream&, bool)
solidParticle.H:135:9: note:  candidate expects 3 arguments, 7 provided
solidParticleI.H:47:8: note: Foam::solidParticle::solidParticle(const Foam::polyMesh&, const vector&, Foam::label, Foam::label, Foam::label, Foam::scalar, const vector&)
solidParticleI.H:47:8: note:  no known conversion for argument 1 from ‘Foam::solidParticleCloud’ to ‘const Foam::polyMesh&’
solidParticle.H:58:7: note: Foam::solidParticle::solidParticle(const Foam::solidParticle&)
solidParticle.H:58:7: note:  candidate expects 1 argument, 7 provided



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