CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Reading Lagrangian Position Data (https://www.cfd-online.com/Forums/openfoam-post-processing/225531-reading-lagrangian-position-data.html)

xhan July 31, 2023 03:26

Quote:

Originally Posted by xhan (Post 854319)
Hi,
Thanks for sharing your idea, cjc96.
However, when i followed all your comment above and compiled my new intermediate, there was always an error message "class 'Foam::KinematicParcel<parceltype>'does not have any field named globalpos".
I have no idea how to deal with this. could you please tell us more details of your idea?

i have solved this error and i can see the global position now.
it's helpful. Thanks a lot!!!

joshwilliams July 31, 2023 05:21

Quote:

Originally Posted by xhan (Post 854319)
Hi,
Thanks for sharing your idea, cjc96.
However, when i followed all your comment above and compiled my new intermediate, there was always an error message "class 'Foam::KinematicParcel<parceltype>'does not have any field named globalpos".
I have no idea how to deal with this. could you please tell us more details of your idea?

You need to add 'globalPos' to the header files (you are defining a new field, adding to headers is a standard task in C++). Also, he did not share the code for the actual IO part. Since the p.position already exists, my suggestion is just modify KinematicParcelIO.C



You can copy the code in the IO C file, where a particle field is defined such as p.UTurb() and add similar code for p.position().

cjc96 July 31, 2023 11:30

Quote:

Originally Posted by xhan (Post 854356)
i have solved this error and i can see the global position now.
it's helpful. Thanks a lot!!!


Hey Xhan,
I'm glad you sorted it!


Figured I'd post a link to my GitHub repository that includes these changes as well as others, in case they are of use to you, or anyone else:


https://github.com/ttcjc/OpenFOAM/tree/dev


All times are GMT -4. The time now is 03:45.