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

Multiphase Solid Particle Tracking

Register Blogs Community New Posts Updated Threads Search

Like Tree16Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 29, 2015, 04:07
Default
  #41
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17
vonboett is on a distinguished road
Hi pnovo, thanks for posting the nice tutorial. However as you maybe saw the comment in the code:
/*this solver is not to be used for simulations that resemble the real world.It’s just a demo.*/


you may want to use icoUncoupledKinematicParcelFoam as a starting point together with basicKinematicCollidingCloud.H in the header of the solver.
Anyway, what you need for your error is
#include "readGravitationalAcceleration.H" in your solver header before starting the time loop. Or take a look at the createFields.H of interFOAM etc. how it is done there.

The problematic part is more adding the particle force to the momentum equation, I am stuck there...
raniza likes this.
vonboett is offline   Reply With Quote

Old   September 29, 2015, 06:05
Default
  #42
New Member
 
novo
Join Date: Jun 2015
Posts: 11
Rep Power: 11
pnovo is on a distinguished road
Thank you for your tips. Now I ran into some other errors upon compilation, but I'll have a careful look at it later. For now I will also give a try using the solver you pointed out and look into the files used for compilation. 'Would be nice if you post any (also towards) successful developments.
pnovo is offline   Reply With Quote

Old   October 1, 2015, 06:27
Default
  #43
New Member
 
novo
Join Date: Jun 2015
Posts: 11
Rep Power: 11
pnovo is on a distinguished road
Hi again,
So I have looked a bit into the icoUncoupledKinematicParcelFoam tutorials, ran them and looked into some of the header files included. Now I was trying to make a simulation in which I do not have manually defined positions for the particles, but rather an injection via an inlet, 'say using elbow example located in the icoFoam tutorial folder and by using the last time point from the icoFoam run as the "0" folder for the run with icoUncoupledKinematicParcelFoam.

So I changed the injectionModels type to patchInjection:

Code:
type pathInjection;
nParticle 1000;
massTotal 1;
parcelBasisType fixed;
patchName velocity-inlet-5;
parcelsPerSecond 100000;
duration 1;
U0 (0 0.1 0); // just forced the particle to move on the y direction - doubts here
flowRateProfile constant 1;
SOI 0;
Could you give me help on how to define the U0 to read the "U" file in the 0/ directory? Also, do you know what does the flowRateProfile defines? Although I got some info from here, I could not really understand it (not due to the fact of been written in German ).

Thanks
pnovo is offline   Reply With Quote

Old   January 13, 2016, 20:29
Default Particle tracking
  #44
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Hello everyone,
I have been stuck to a problem with particle tracking. In openfoam, all the solvers are designed to inject particles from a certain location for all time steps. But I want to inject particles form different cells, at each time step.
Lets say we have a temperature field calculated at each time step. I want to inject particles at each time step from cells with certain temperature (e.g. T=200K). Can anyone help me with this.

Thanks in advance.
hojjat.m is offline   Reply With Quote

Old   January 14, 2016, 02:55
Default
  #45
Member
 
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14
Mahdi2010 is on a distinguished road
Quote:
Originally Posted by hojjat.m View Post
Hello everyone,
I have been stuck to a problem with particle tracking. In openfoam, all the solvers are designed to inject particles from a certain location for all time steps. But I want to inject particles form different cells, at each time step.
Lets say we have a temperature field calculated at each time step. I want to inject particles at each time step from cells with certain temperature (e.g. T=200K). Can anyone help me with this.

Thanks in advance.
If you wanna inject particles per cell (not for instance bubbles or drops which would undergo coalescence/breakup), this can be simply done. You only need to define an injection function in the particle cloud class. Then following this (rough) algorithm:

forAll cells

{ if T[cell] == 200

{
add a particle to the cloud
}

}


So, this needs a bit hard coding because you should be able to build a connection between Eulerian fields (i.e. T) and Lagrangian data (i.e. d, U, ...). The best material to read is the tutorial below:

http://www.tfd.chalmers.se/~hani/kur...LPT_120911.pdf
Mahdi2010 is offline   Reply With Quote

Old   January 14, 2016, 12:14
Default
  #46
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Thanks for the reply Mahdi,

I've gone through this tutorial, and as you mentioned my main problem is how to call for Eulerian parameters in the solidParticleCloud.C file.
hojjat.m is offline   Reply With Quote

Old   January 14, 2016, 12:21
Default
  #47
Member
 
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14
Mahdi2010 is on a distinguished road
Quote:
Originally Posted by hojjat.m View Post
Thanks for the reply Mahdi,

I've gone through this tutorial, and as you mentioned my main problem is how to call for Eulerian parameters in the solidParticleCloud.C file.

Yes you need to implement it within the function "inject" inside the function "move".
As I said this is not difficult at all, but needs some efforts. Just follow the instruction in the report, If you have problem share it here.
Mahdi2010 is offline   Reply With Quote

Old   January 14, 2016, 14:46
Default
  #48
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Mahdi,

I followed the instructions, and I have added the following to solidParticleCloud.C file (I have added the T interpolations to all files required):

void Foam::solidParticleCloud::inject(solidParticle::tr ackingData &td)
{
forAll (T, celli)
{
if (T[celli]==200)
{
scalar posx=mesh.C().component(0);
scalar posy=mesh.C().component(1);
scalar posz=mesh.C().component(2);
vector pos=vector(posx,posy,posz);
vector vel=vel_;

label cellI=1;
label tetFaceI=1;
label tetPtI=1;
mesh_.findCellFacePt(td.cloud().pos,cellI,tetFaceI ,tetPtI);
solidParticle* ptr= new solidParticle(mesh_,td.cloud().pos,cellI,tetFaceI, tetPtI,td.cloud().d(),td.cloud().vel);
Cloud<solidParticle>::addParticle(ptr);

}

}
}

What I am trying to do, is to read the cell centers of cells with T=200, and assign them as the position for injecting particles.
After getting rid of some of the errors, I finally get the following errors, which are due to the link between Eulerian and Lagrangian fields:

solidParticleCloud.C: In member function ‘void Foam::solidParticleCloud::inject(Foam::solidPartic le::trackingData&)’:
solidParticleCloud.C:102:3: error: ‘T’ was not declared in this scope
solidParticleCloud.C:107:23: error: ‘((Foam::solidParticleCloud*)this)->Foam::solidParticleCloud::mesh’ does not have class type
solidParticleCloud.C:108:23: error: ‘((Foam::solidParticleCloud*)this)->Foam::solidParticleCloud::mesh’ does not have class type
solidParticleCloud.C:109:23: error: ‘((Foam::solidParticleCloud*)this)->Foam::solidParticleCloud::mesh’ does not have class type
solidParticleCloud.C:116:38: error: ‘class Foam::solidParticleCloud’ has no member named ‘pos’
solidParticleCloud.C:117:61: error: ‘class Foam::solidParticleCloud’ has no member named ‘pos’
make: *** [Make/linux64GccDPOpt/solidParticleCloud.o] Error 1

I really appreciate your help.
Thanks
hojjat.m is offline   Reply With Quote

Old   January 15, 2016, 05:05
Default
  #49
Member
 
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14
Mahdi2010 is on a distinguished road
Quote:
Originally Posted by hojjat.m View Post
Mahdi,

I followed the instructions, and I have added the following to solidParticleCloud.C file (I have added the T interpolations to all files required):

void Foam::solidParticleCloud::inject(solidParticle::tr ackingData &td)
{
forAll (T, celli)
{
if (T[celli]==200)
{
scalar posx=mesh.C().component(0);
scalar posy=mesh.C().component(1);
scalar posz=mesh.C().component(2);
vector pos=vector(posx,posy,posz);
vector vel=vel_;

label cellI=1;
label tetFaceI=1;
label tetPtI=1;
mesh_.findCellFacePt(td.cloud().pos,cellI,tetFaceI ,tetPtI);
solidParticle* ptr= new solidParticle(mesh_,td.cloud().pos,cellI,tetFaceI, tetPtI,td.cloud().d(),td.cloud().vel);
Cloud<solidParticle>::addParticle(ptr);

}

}
}

What I am trying to do, is to read the cell centers of cells with T=200, and assign them as the position for injecting particles.
After getting rid of some of the errors, I finally get the following errors, which are due to the link between Eulerian and Lagrangian fields:

solidParticleCloud.C: In member function ‘void Foam::solidParticleCloud::inject(Foam::solidPartic le::trackingData&)’:
solidParticleCloud.C:102:3: error: ‘T’ was not declared in this scope
solidParticleCloud.C:107:23: error: ‘((Foam::solidParticleCloud*)this)->Foam::solidParticleCloud::mesh’ does not have class type
solidParticleCloud.C:108:23: error: ‘((Foam::solidParticleCloud*)this)->Foam::solidParticleCloud::mesh’ does not have class type
solidParticleCloud.C:109:23: error: ‘((Foam::solidParticleCloud*)this)->Foam::solidParticleCloud::mesh’ does not have class type
solidParticleCloud.C:116:38: error: ‘class Foam::solidParticleCloud’ has no member named ‘pos’
solidParticleCloud.C:117:61: error: ‘class Foam::solidParticleCloud’ has no member named ‘pos’
make: *** [Make/linux64GccDPOpt/solidParticleCloud.o] Error 1

I really appreciate your help.
Thanks
How did you define the scalarField T in this class? The error says you have not defined T yet. Please put the .H and .C files here, then I can see what you have done.
hojjat.m likes this.
Mahdi2010 is offline   Reply With Quote

Old   January 15, 2016, 06:05
Default
  #50
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17
vonboett is on a distinguished road
Quote:
Originally Posted by hojjat.m View Post
Hello everyone,
I have been stuck to a problem with particle tracking. In openfoam, all the solvers are designed to inject particles from a certain location for all time steps. But I want to inject particles form different cells, at each time step.
Lets say we have a temperature field calculated at each time step. I want to inject particles at each time step from cells with certain temperature (e.g. T=200K). Can anyone help me with this.

Thanks in advance.
Hi, do the particles injected influence the temperature field?

Of course, implementing your custom injection is the best way! But maybe you want to compare results then by running your case without particle injections, see where and when you want particles injected due to temperature and then rerun the case with standard particle injectors pre-defining the SOI valuie to match the time particles should enter at that spot...
vonboett is offline   Reply With Quote

Old   January 15, 2016, 11:42
Default
  #51
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Quote:
Originally Posted by Mahdi2010 View Post
How did you define the scalarField T in this class? The error says you have not defined T yet. Please put the .H and .C files here, then I can see what you have done.
Mahdi,
I have just defined T at createFields.H, for the Eulerian field. I have attached the whole files of .C and .H for the solidParticle solver.

Thanks
Attached Files
File Type: gz solidParticleTrack.tar.gz (6.4 KB, 40 views)
hojjat.m is offline   Reply With Quote

Old   January 15, 2016, 11:46
Default
  #52
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Quote:
Originally Posted by vonboett View Post
Hi, do the particles injected influence the temperature field?

Of course, implementing your custom injection is the best way! But maybe you want to compare results then by running your case without particle injections, see where and when you want particles injected due to temperature and then rerun the case with standard particle injectors pre-defining the SOI valuie to match the time particles should enter at that spot...
Albrecht,
The particlesare injected at certain cells and at each time step, Unfortunately, all of the injectors are designed to inject particles from SOI to EOI, from same location.
For my case, particles are injected each time step from certain cells, so SOI is meaningless.
hojjat.m is offline   Reply With Quote

Old   January 15, 2016, 13:28
Default
  #53
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Quote:
Originally Posted by Mahdi2010 View Post
How did you define the scalarField T in this class? The error says you have not defined T yet. Please put the .H and .C files here, then I can see what you have done.
Mahdi,
I defined T field at solidParticleCloud.H, and after some modification at the solidParticleCloud.C :

void Foam::solidParticleCloud::inject(solidParticle::tr ackingData &td)
{
const volScalarField& dInc = mesh_.lookupObject<const volScalarField>("dInc");
forAll (T, celli)
{
if (T[celli==0)
{
label cellI=1;
label tetFaceI=1;
label tetPtI=1;
solidParticle* ptr= new solidParticle(mesh_,pos,cellI,tetFaceI,tetPtI,td.c loud().d,vel);
Cloud<solidParticle>::addParticle(ptr);
}
}
}

It seems that T field is read, however, I get thje following error, which is the particle injection part:

injectionsolidParticleCloud.C: In member function ‘void Foam::solidParticleCloud::inject(Foam::solidPartic le::trackingData&)’:
solidParticleCloud.C:112:92: error: no matching function for call to ‘Foam::solidParticle::solidParticle(const Foam::fvMesh&, <unresolved overloaded function type>, Foam::label&, Foam::label&, Foam::label&, <unresolved overloaded function type>, <unresolved overloaded function type>)’
solidParticleCloud.C:112:92: note: candidates are:
In file included from solidParticleCloud.H:41:0,
from solidParticleCloud.C:26:
solidParticle.H:136:9: note: Foam::solidParticle::solidParticle(const Foam:olyMesh&, Foam::Istream&, bool)
solidParticle.H:136:9: note: candidate expects 3 arguments, 7 provided
In file included from solidParticle.H:264:0,
from solidParticleCloud.H:41,
from solidParticleCloud.C:26:
solidParticleI.H:47:8: note: Foam::solidParticle::solidParticle(const Foam:olyMesh&, const vector&, Foam::label, Foam::label, Foam::label, Foam::scalar, const vector&)
solidParticleI.H:47:8: note: no known conversion for argument 2 from ‘<unresolved overloaded function type>’ to ‘const vector& {aka const Foam::Vector<double>&}’
In file included from solidParticleCloud.H:41:0,
from solidParticleCloud.C:26:
solidParticle.H:59:7: note: Foam::solidParticle::solidParticle(const Foam::solidParticle&)
solidParticle.H:59:7: note: candidate expects 1 argument, 7 provided
make: *** [Make/linux64GccDPOpt/solidParticleCloud.o] Error 1
hojjat.m is offline   Reply With Quote

Old   January 17, 2016, 05:40
Default
  #54
Member
 
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14
Mahdi2010 is on a distinguished road
Quote:
Originally Posted by hojjat.m View Post
Mahdi,
I defined T field at solidParticleCloud.H, and after some modification at the solidParticleCloud.C :

void Foam::solidParticleCloud::inject(solidParticle::tr ackingData &td)
{
const volScalarField& dInc = mesh_.lookupObject<const volScalarField>("dInc");
forAll (T, celli)
{
if (T[celli==0)
{
label cellI=1;
label tetFaceI=1;
label tetPtI=1;
solidParticle* ptr= new solidParticle(mesh_,pos,cellI,tetFaceI,tetPtI,td.c loud().d,vel);
Cloud<solidParticle>::addParticle(ptr);
}
}
}

It seems that T field is read, however, I get thje following error, which is the particle injection part:

injectionsolidParticleCloud.C: In member function ‘void Foam::solidParticleCloud::inject(Foam::solidPartic le::trackingData&)’:
solidParticleCloud.C:112:92: error: no matching function for call to ‘Foam::solidParticle::solidParticle(const Foam::fvMesh&, <unresolved overloaded function type>, Foam::label&, Foam::label&, Foam::label&, <unresolved overloaded function type>, <unresolved overloaded function type>)’
solidParticleCloud.C:112:92: note: candidates are:
In file included from solidParticleCloud.H:41:0,
from solidParticleCloud.C:26:
solidParticle.H:136:9: note: Foam::solidParticle::solidParticle(const Foam:olyMesh&, Foam::Istream&, bool)
solidParticle.H:136:9: note: candidate expects 3 arguments, 7 provided
In file included from solidParticle.H:264:0,
from solidParticleCloud.H:41,
from solidParticleCloud.C:26:
solidParticleI.H:47:8: note: Foam::solidParticle::solidParticle(const Foam:olyMesh&, const vector&, Foam::label, Foam::label, Foam::label, Foam::scalar, const vector&)
solidParticleI.H:47:8: note: no known conversion for argument 2 from ‘<unresolved overloaded function type>’ to ‘const vector& {aka const Foam::Vector<double>&}’
In file included from solidParticleCloud.H:41:0,
from solidParticleCloud.C:26:
solidParticle.H:59:7: note: Foam::solidParticle::solidParticle(const Foam::solidParticle&)
solidParticle.H:59:7: note: candidate expects 1 argument, 7 provided
make: *** [Make/linux64GccDPOpt/solidParticleCloud.o] Error 1
I went through your code and I finally got what's wrong with the impelementation.
In solidParticleCloud.C within the function inject you define the following:

td(*this, rhoInterp, UInterp, TInterp, nuInterp, g.value());

but the point is that td(= tracking data class) has a function which does not recognize any temperature field. I mean td function does not include any T (see line 76 of this).

It means that any particle that is going to be added to the solidParticleCloud should be defined within this function with the arguments rho, U, nu and g. But you did not modify this function. If you wanna use "T" as one of the arguments of this function, you should modify that as well.
Mahdi2010 is offline   Reply With Quote

Old   January 17, 2016, 19:19
Default
  #55
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Quote:
Originally Posted by Mahdi2010 View Post
I went through your code and I finally got what's wrong with the impelementation.
In solidParticleCloud.C within the function inject you define the following:

td(*this, rhoInterp, UInterp, TInterp, nuInterp, g.value());

but the point is that td(= tracking data class) has a function which does not recognize any temperature field. I mean td function does not include any T (see line 76 of this).

It means that any particle that is going to be added to the solidParticleCloud should be defined within this function with the arguments rho, U, nu and g. But you did not modify this function. If you wanna use "T" as one of the arguments of this function, you should modify that as well.
I have already added TInterp to solidParticle.H file, but I still get errors. I have problem in adding the particle, I don't know how to assign the cell center to inject particles.
Attached Files
File Type: h solidParticle.H (7.1 KB, 10 views)
hojjat.m is offline   Reply With Quote

Old   January 18, 2016, 03:09
Default
  #56
Member
 
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14
Mahdi2010 is on a distinguished road
Quote:
Originally Posted by hojjat.m View Post
I have already added TInterp to solidParticle.H file, but I still get errors. I have problem in adding the particle, I don't know how to assign the cell center to inject particles.

Did you modify solidParticleI.H as well?
If so, I would say put the error you get here.

In addition, for cell center I guess you may simply use: "findTetFacePt" function or other functions like that. This can give you some hints
Mahdi2010 is offline   Reply With Quote

Old   January 19, 2016, 17:09
Default
  #57
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Quote:
Originally Posted by Mahdi2010 View Post
Did you modify solidParticleI.H as well?
If so, I would say put the error you get here.

In addition, for cell center I guess you may simply use: "findTetFacePt" function or other functions like that. This can give you some hints
So basically I have been stuck here:
I have a volumeVectorField (mesh_.C() which is the cell center of each mesh. But in function findCellFacePt(pos, cellI, tetFaceI, tetPtI), the pos label is for vector not volumeVectorField, so I get the following error:

error: no matching function for call to ‘Foam::fvMesh::findCellFacePt(Foam::volVectorField &, Foam::label&, Foam::label&, Foam::label&) const’

Any hints on that?
hojjat.m is offline   Reply With Quote

Old   January 20, 2016, 02:35
Default
  #58
Member
 
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14
Mahdi2010 is on a distinguished road
Quote:
Originally Posted by hojjat.m View Post
So basically I have been stuck here:
I have a volumeVectorField (mesh_.C() which is the cell center of each mesh. But in function findCellFacePt(pos, cellI, tetFaceI, tetPtI), the pos label is for vector not volumeVectorField, so I get the following error:

error: no matching function for call to ‘Foam::fvMesh::findCellFacePt(Foam::volVectorField &, Foam::label&, Foam::label&, Foam::label&) const’

Any hints on that?
I see. The only thing that I can offer is to use this format:

findTetFacePt(cellI,pt,tetFaceI,tetPtI);

instead of function "findCellFacePt". In this way the cell centers can be represented by
"pt" which will not be a volume vector anymore. But besides the labels like tetFace and
tetPtI, you need to define "pt" as well.
Mahdi2010 is offline   Reply With Quote

Old   January 21, 2016, 07:35
Default interFoam + LPT with solidParticleCloud
  #59
New Member
 
alexlupo's Avatar
 
Alejandro López
Join Date: Mar 2013
Location: Bilbao
Posts: 16
Rep Power: 13
alexlupo is on a distinguished road
Hi all,

This is not really related to the discussion right now but I got a private message asking for the upgraded code of Aurelia Vallier's tutorial so I compiled and tested it for OF2.3.x and I thought someone could use it so I decided to post it here together with the particleProperties dictionary and some additional files.
Hope it helps.
Cheers!
Attached Files
File Type: zip interLPTFoam.zip (20.0 KB, 108 views)
File Type: zip additionalFiles.zip (4.8 KB, 93 views)
Ebrahim, dongchao yang and mcfdma like this.
__________________
Alex

Last edited by alexlupo; January 21, 2016 at 09:44. Reason: Add files
alexlupo is offline   Reply With Quote

Old   January 21, 2016, 08:45
Default
  #60
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17
vonboett is on a distinguished road
Hi Alex,
the attachment is empty I think...
vonboett is offline   Reply With Quote

Reply

Tags
interfoam, lagrangian, move, solidparticle


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
lagrangian solid particle tracking - OFv2.1 PelusDadidus OpenFOAM Programming & Development 7 August 21, 2015 10:05
Questions regarding Particle Tracking and Rotating Frame of reference Maxime Gauthier CFX 1 May 9, 2011 16:07
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 02:29
Particle tracking - Domain interface / FrozenRotor mohanrao CFX 4 January 23, 2008 04:39
restarting lagrange (particle tracking) simulation dbdias CFX 0 September 22, 2007 20:26


All times are GMT -4. The time now is 01:49.