|
[Sponsors] |
September 22, 2017, 03:37 |
Lagrangian particle position data at runtime
|
#1 | |
Member
Vishwesh Ravi Shrimali
Join Date: Aug 2017
Posts: 43
Rep Power: 9 |
Hi!
I am making a solver which has a section where the following process needs to be carried out:
Now, I can carry out the second part of it. I know from some research that it is possible to obtain the particles' information (positions in my case). I am trying out the following code: Code:
const kinematicCloud & a = obr_.lookupObject<kinematicCloud> ("kinematicCloud"); basicKinematicCloud * q = (basicKinematicCloud*) &a; forAllIter(basicKinematicCloud, *q, pIter) { Pout<<"particle position: "<<pIter.positions()<<endl; } Quote:
Code:
#include "basicKinematicCloud.H" #include "particle.H" // for tracking particle position Thanks Vishwesh |
||
September 22, 2017, 10:41 |
|
#2 |
New Member
Join Date: Aug 2017
Posts: 10
Rep Power: 9 |
Hello Vishwesh,
did you found a solution? I'm stuck with the same problem here... for this code Code:
const kinematicCloud& a = obr_.lookupObject<kinematicCloud> ("kinematicCloud"); basicKinematicCloud * q = (basicKinematicCloud*) &a; forAllIter(basicKinematicCloud, *q, pIter) { Info << pIter().position() << endl; } Code:
myInterFoam.C: In Funktion »int main(int, char**)«: myInterFoam.C:117:19: Fehler: »kinematicCloud« bezeichnet keinen Typ const kinematicCloud & a = obr_.lookupObject<kinematicCloud> ("kinematicCloud"); ^ myInterFoam.C:118:63: Fehler: »a« wurde in diesem Gültigkeitsbereich nicht definiert basicKinematicCloud * q = (basicKinematicCloud*) &a; ^ myInterFoam.C:118:63: Warnung: Verwendung einer Typumwandlung im alten Stil [-Wold-style-cast] myInterFoam.C:122:52: Fehler: »Foam::Cloud<Foam::KinematicParcel<Foam::particle> >::iterator« hat kein Element namens »positions« Pout<<"particle position: "<<pIter.positions()<<endl; Maybe it's due to the upper code because it's from openfoam 1.7. So maybe something changed in the syntax... |
|
September 22, 2017, 10:43 |
|
#3 |
Member
Vishwesh Ravi Shrimali
Join Date: Aug 2017
Posts: 43
Rep Power: 9 |
Hi
I am yet to find a solution for this. Let's see if someone else can help us out. |
|
July 11, 2018, 10:48 |
|
#4 |
New Member
Stanislav Knotek
Join Date: Nov 2013
Location: Brno
Posts: 3
Rep Power: 13 |
Hi,
What about pIter.positions() vs pIter().position() ? pIter().position() works to me. Last edited by Stanislav; July 12, 2018 at 04:41. |
|
Tags |
kinematiccloud, lagrangian particles, openfoam 3.0.x |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
particles leave domain | Steffen595 | CFX | 9 | March 7, 2016 17:19 |
Uniform inlet particle distribution without position file | mayank.dce2k7 | OpenFOAM Running, Solving & CFD | 0 | December 5, 2013 18:24 |
Particle Reynolds number calculation in Lagrangian tracking? | jiejie | OpenFOAM Running, Solving & CFD | 5 | July 6, 2012 05:47 |
how to know position of particle in PTK | areriko | CFX | 0 | November 19, 2007 22:19 |
how to output particle trajectory coordinate data | steven | CFX | 0 | July 13, 2006 18:49 |