|
[Sponsors] |
September 29, 2015, 04:07 |
|
#41 |
Senior Member
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17 |
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... |
|
September 29, 2015, 06:05 |
|
#42 |
New Member
novo
Join Date: Jun 2015
Posts: 11
Rep Power: 11 |
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.
|
|
October 1, 2015, 06:27 |
|
#43 |
New Member
novo
Join Date: Jun 2015
Posts: 11
Rep Power: 11 |
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; Thanks |
|
January 13, 2016, 20:29 |
Particle tracking
|
#44 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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. |
|
January 14, 2016, 02:55 |
|
#45 | |
Member
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14 |
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 |
||
January 14, 2016, 12:14 |
|
#46 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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. |
|
January 14, 2016, 12:21 |
|
#47 | |
Member
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14 |
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. |
||
January 14, 2016, 14:46 |
|
#48 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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 |
|
January 15, 2016, 05:05 |
|
#49 | |
Member
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14 |
Quote:
|
||
January 15, 2016, 06:05 |
|
#50 | |
Senior Member
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17 |
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... |
||
January 15, 2016, 11:42 |
|
#51 | |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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 |
||
January 15, 2016, 11:46 |
|
#52 | |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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. |
||
January 15, 2016, 13:28 |
|
#53 | |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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: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 |
||
January 17, 2016, 05:40 |
|
#54 | |
Member
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14 |
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. |
||
January 17, 2016, 19:19 |
|
#55 | |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
Quote:
|
||
January 18, 2016, 03:09 |
|
#56 | |
Member
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14 |
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 |
||
January 19, 2016, 17:09 |
|
#57 | |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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? |
||
January 20, 2016, 02:35 |
|
#58 | |
Member
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14 |
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. |
||
January 21, 2016, 07:35 |
interFoam + LPT with solidParticleCloud
|
#59 |
New Member
Alejandro López
Join Date: Mar 2013
Location: Bilbao
Posts: 16
Rep Power: 13 |
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!
__________________
Alex Last edited by alexlupo; January 21, 2016 at 09:44. Reason: Add files |
|
January 21, 2016, 08:45 |
|
#60 |
Senior Member
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17 |
Hi Alex,
the attachment is empty I think... |
|
Tags |
interfoam, lagrangian, move, solidparticle |
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |