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

OpenFOAM] Can I plot the lagrangian particle velocity to field velocity

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By massive_turbulence
  • 1 Post By massive_turbulence
  • 1 Post By raumpolizei

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2019, 22:53
Default OpenFOAM] Can I plot the lagrangian particle velocity to field velocity
  #1
New Member
 
Seokwon Whang
Join Date: May 2012
Posts: 25
Rep Power: 13
hswzzz is on a distinguished road
I tried to post the Lagrangian data. Especially, I want to post the particle velocity on certain line.* (I use reactingParcelFoam, and there are*no particles which are exactly on the line.)


Therefore, I think that the Lagrangian particle data in the time folder (0/reactingCloud1/ U, T, position,*etc.) should be converted into the field data. (Is it right?)


How can I*convert the Lagrangian data to*Eulerian data in OpenFOAM?
hswzzz is offline   Reply With Quote

Old   February 12, 2019, 08:44
Default
  #2
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 12
massive_turbulence is on a distinguished road
Quote:
Originally Posted by hswzzz View Post
I tried to post the Lagrangian data. Especially, I want to post the particle velocity on certain line.* (I use reactingParcelFoam, and there are*no particles which are exactly on the line.)


Therefore, I think that the Lagrangian particle data in the time folder (0/reactingCloud1/ U, T, position,*etc.) should be converted into the field data. (Is it right?)


How can I*convert the Lagrangian data to*Eulerian data in OpenFOAM?
From what I know theoretically, in order for you to convert particle motion into a field (volume) you'd have to keep your momentum equation conserved which is probably much too difficult in my opinion.

The best solution I've see so far for plotting your data was this thread

Sampling lagrangian data

"1. start paraFoam
2. load the lagrangian data in addition to the "regular" data
3. "Split off" the lagrangian data using the "Extract Block"-filter
4. Open a new view on the result and make that view a "Spreadsheet view". In that view you will see the raw lagrangian data
5. File->Export that view to a CSV-file
"
hswzzz likes this.
massive_turbulence is offline   Reply With Quote

Old   February 13, 2019, 22:36
Default
  #3
New Member
 
Seokwon Whang
Join Date: May 2012
Posts: 25
Rep Power: 13
hswzzz is on a distinguished road
Thank you for answering my question.

If I follow your answer, I get the “point data” for each lagranian particle, not the “field data”.
What I want to do is to convert this “point data” to “field data”.

Thank you again for your reply.
hswzzz is offline   Reply With Quote

Old   February 13, 2019, 23:30
Default
  #4
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 12
massive_turbulence is on a distinguished road
Quote:
Originally Posted by hswzzz View Post
Thank you for answering my question.

If I follow your answer, I get the “point data” for each lagranian particle, not the “field data”.
What I want to do is to convert this “point data” to “field data”.

Thank you again for your reply.
Fields are just generalizations of velocity, pressure, etc. They are more like cells or volumes. Lagrangian motion is specifically a particle with the attributes of mass and velocity, the difference is that density in a volume can change and this is the part that makes conversion from one to another difficult.

Say you have two equally massed particles in a cubic cm at an instant and they have a mass of 2 grams, so then in that cell you can compute what density is and there's your Euler data, but two seconds later the particles with different vectors now occupy two cells each and now each cell has half the density.

Writing the program to do this is possible, just use hashing like octrees or something, it's just complicated and needs tons of ram.

Maybe someone else could explain a better solution, regards.
hswzzz likes this.
massive_turbulence is offline   Reply With Quote

Old   September 8, 2019, 23:07
Default
  #5
New Member
 
lgz
Join Date: Apr 2019
Posts: 4
Rep Power: 6
xgyn is on a distinguished road
Quote:
Originally Posted by hswzzz View Post
I tried to post the Lagrangian data. Especially, I want to post the particle velocity on certain line.* (I use reactingParcelFoam, and there are*no particles which are exactly on the line.)


Therefore, I think that the Lagrangian particle data in the time folder (0/reactingCloud1/ U, T, position,*etc.) should be converted into the field data. (Is it right?)


How can I*convert the Lagrangian data to*Eulerian data in OpenFOAM?
Hi, I have met the same question with you. Have you fixed the problem? In addition, do you know which 'Class' determine the output file of particle's velocities (0/reactingCloud1/ U) ?
xgyn is offline   Reply With Quote

Old   September 11, 2019, 17:15
Default
  #6
Member
 
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7
raumpolizei is on a distinguished road
I have some doubts if this is really what you want. Usually, you will have a limited amount of parcels (or real particles) in each computational cell. The number will probably not be large enough to create meaningful statistics in one cell. If you want a representative velocity for your particle phase in a cell, I think you have to gather the particles crossing that cell over time and calculate a mean or rms velocity by using the velocity moments of the resulting distribution. This a similar to calculating the SMD of a distribution, only that you are working with velocities. Hope this helps. Cheers RP
joshwilliams likes this.
raumpolizei is offline   Reply With Quote

Old   February 2, 2022, 03:23
Default
  #7
Senior Member
 
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 112
Rep Power: 5
joshwilliams is on a distinguished road
To extract Eulerian statistics, you can add an extra class to perform averaging at run-time, which is what I usually do. This is much better for getting mean + rms statistics over time.



For instantaneous statistics, you can write a functionObject which does the following (as a brute force, fairly simple approach):

0. Create a new Eulerian field (i.e. "UpTilde")

1. Read particle data
2. Loop over all particles and assign their velocities to the field (UpTilde[p.cell()] += p.U())
3. Perform averaging by looping over all cells with more than a pre-specified number of particles (to ensure the statistics are robust and not effected by cells with only 1-2 particles).
4. To extract second order statistics like RMS you will need to perform this again.



When I implemented this, I thought it would be pretty slow but it did not take much time (tested on up to 10million particle simulation with 1 million cells).
joshwilliams is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[OpenFOAM] Plot over line average magnitude of particle velocity in paraview maysmech ParaView 13 August 12, 2022 12:46
[swak4Foam] Validation of swak4Foam for lagrangian particle tracking nero235 OpenFOAM Community Contributions 13 March 28, 2017 06:45
Unsteady field advected by steady velocity field t.oliveira OpenFOAM Running, Solving & CFD 2 December 28, 2015 14:42
injection problem Mark New FLUENT 0 August 4, 2013 02:30
Check particle impaction with User Fortran Julian K. CFX 3 January 12, 2012 10:46


All times are GMT -4. The time now is 21:12.