CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to get the particle position from Barycentric coordinates? (https://www.cfd-online.com/Forums/openfoam-solving/191655-how-get-particle-position-barycentric-coordinates.html)

seasoul August 15, 2017 12:23

How to get the particle position from Barycentric coordinates?
 
Since version 5.0, Barycentric methods are used for tracking particles, which makes the solver more robust. But the results show the Barycentric coordinates instead of the position in the old version.

If I want the global coordinates, i.e., the real position of the particle, how do I process the tracking data?

Thanks,

Wu Yu

guin August 16, 2017 02:19

you can do it as usual, by using position() instead of coordinates()

seasoul August 16, 2017 03:04

Yes, Guin,

It works very well. Thank you.


Quote:

Originally Posted by guin (Post 660856)
you can do it as usual, by using position() instead of coordinates()


aghsin September 5, 2017 06:25

I wanna inject a particle to the numerical domain. I know the Cartesian position of the particle but the constructor of solidParticle class only accept the coordinate in barycentric coordinates how I can convert the Cartesian to barycentric.

foamy123 March 5, 2018 10:12

hi,
where can I find the parcel coordinates() in global cartesian form?

I'm running reactingParcelFoam in OF-Version 5.x (updated today) and in my folder "reactingCloud1Tracks" I only get a "positions" file and no "coordinates" file. The "positions" file only contains the parcel locations in barycentric form.

I also tried placing

InfoSwitches
{
...
// Write lagrangian "positions" file in v1706 format (at earlier)
// if set to 1
writeLagrangianPositions 1;
...

into my controlDict in /opt/openfoam5/etc/ but it didn't help.

Any method to convert the barycentric coordinates to global cartesian would be appreciated as well.

sprayFoamer June 29, 2018 08:27

Quote:

Originally Posted by seasoul (Post 660864)
Yes, Guin,

It works very well. Thank you.


I am quite new to OpenFoam and using sprayFoam right now. I searched a bit through the src or app, but I don't understand where exactly you need to change coordinates() to position() in order to get the cartesian coordinates of the particles. Can you help me?



Thank you in advance!

sprayFoamer July 6, 2018 04:28

Quote:

Originally Posted by guin (Post 660856)
you can do it as usual, by using position() instead of coordinates()

I am quite new to OpenFoam and using sprayFoam right now. I searched a bit through the src or app, but I don't understand where exactly you need to change coordinates() to position() in order to get the cartesian coordinates of the parcels. Can you help me?

Thank you in advance!

upc_ngh November 3, 2019 04:28

hello,now i also have the same problems like you.Did you have some good ideas or have already solved it.

sprayFoamer November 4, 2019 02:59

Hey,
I basically used paraview to convert and export the cartesian coordinates.
Best Regards

upc_ngh November 4, 2019 03:23

cartesian coordinates
 
Quote:

Originally Posted by sprayFoamer (Post 748776)
Hey,
I basically used paraview to convert and export the cartesian coordinates.
Best Regards

hey,thanks for answering me!Now,I am a newer of paraview.can you tell me more detailed?I Thank you very much!!!

upc_ngh November 4, 2019 03:31

cartesian coordinates
 
Quote:

Originally Posted by sprayFoamer (Post 748776)
Hey,
I basically used paraview to convert and export the cartesian coordinates.
Best Regards

can you help me? I am very urgent for this.Can the paraview convert the data to cartesian coordinates?Thank you very much!!!

sprayFoamer November 5, 2019 01:41

Basically you load the lagrangian data in paraview and save it again. The main steps are:


1.) Open ParaFoam, load lagrangian Cloud und choose all the parameters of the parcels you are interested in (diameter, temperature, coordinates, ...)


2.) Save as CSV (choose all timesteps, if you have some) You can now read the cartesian coordinates using another program, e.g. excel, matlab



Of course you are able to script this process using e.g. python

upc_ngh November 5, 2019 02:52

Quote:

Originally Posted by sprayFoamer (Post 748905)
Basically you load the lagrangian data in paraview and save it again. The main steps are:


1.) Open ParaFoam, load lagrangian Cloud und choose all the parameters of the parcels you are interested in (diameter, temperature, coordinates, ...)


2.) Save as CSV (choose all timesteps, if you have some) You can now read the cartesian coordinates using another program, e.g. excel, matlab



Of course you are able to script this process using e.g. python

First thank you very much for answering my question so detailed,but floow your steps,it can't work.Maybe I can't describe my question clearly:
1、I use oprnfoam5,in the lagrangianCloud ,only have a file named positions which used the barycenter coordinate system to record the position of particles;
2、When I save data as CSV,nothing for me to choose,because all of the files in lagrangianCloud are not used the type,I can't save any data.
So do you have some good ideas or I misunderstood your steps,looking forward to hearing from you,thank you again!


Sincerely say thank you!

sprayFoamer November 5, 2019 03:08

[QUOTE=upc_ngh;748914]First thank you very much for answering my question so detailed,but floow your steps,it can't work.Maybe I can't describe my question clearly:
1、I use oprnfoam5,in the lagrangianCloud ,only have a file named positions which used the barycenter coordinate system to record the position of particles;
2、When I save data as CSV,nothing for me to choose,because all of the files in lagrangianCloud are not used the type,I can't save any data.
So do you have some good ideas or I misunderstood your steps,looking forward to hearing from you,thank you again!

Of course I understand the overall problem as stated by your in your first point, that is the whole point of this discussion. Did you manage to open your OpenFOAM result in paraFoam? That should be straightforward:


- open your .openFOAM result case
(if you do not manage to open any result in paraview, create a new text-File with the ending ".openFOAM" in you case folder - this is just to tell paraview that i should expect OpenFOAM data.)


- Before pressing "apply", tick under "sprayCloud" "langrangian"
(if you do not want to load the continous phase untick "internalMesh")



Afterwards save the .csv as described above. If it still doesnt work, please refer to the paraview userguide or another forum.

upc_ngh November 5, 2019 03:22

[QUOTE=sprayFoamer;748915]
Quote:

Originally Posted by upc_ngh (Post 748914)
First thank you very much for answering my question so detailed,but floow your steps,it can't work.Maybe I can't describe my question clearly:
1、I use oprnfoam5,in the lagrangianCloud ,only have a file named positions which used the barycenter coordinate system to record the position of particles;
2、When I save data as CSV,nothing for me to choose,because all of the files in lagrangianCloud are not used the type,I can't save any data.
So do you have some good ideas or I misunderstood your steps,looking forward to hearing from you,thank you again!

Of course I understand the overall problem as stated by your in your first point, that is the whole point of this discussion. Did you manage to open your OpenFOAM result in paraFoam? That should be straightforward:


- open your .openFOAM result case
(if you do not manage to open any result in paraview, create a new text-File with the ending ".openFOAM" in you case folder - this is just to tell paraview that i should expect OpenFOAM data.)


- Before pressing "apply", tick under "sprayCloud" "langrangian"
(if you do not want to load the continous phase untick "internalMesh")



Afterwards save the .csv as described above. If it still doesnt work, please refer to the paraview userguide or another forum.

Thank you very much. I used the "paraFoam &" to open the case in bluecfd5.x,also I floow you steps , but I can't save any data as CSV


All times are GMT -4. The time now is 15:56.