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... |
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.
|
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; Thanks |
Particle tracking
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. |
Quote:
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 |
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. |
Quote:
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. |
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 |
Quote:
|
Quote:
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... |
1 Attachment(s)
Quote:
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 |
Quote:
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. |
Quote:
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::polyMesh&, 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::polyMesh&, 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 |
Quote:
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. |
1 Attachment(s)
Quote:
|
Quote:
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 |
Quote:
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? |
Quote:
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. |
interFoam + LPT with solidParticleCloud
2 Attachment(s)
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! |
Hi Alex,
the attachment is empty I think... |
All times are GMT -4. The time now is 14:34. |