CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Visualize custom results in ParaView (https://www.cfd-online.com/Forums/openfoam-programming-development/222579-visualize-custom-results-paraview.html)

sippanspojk November 29, 2019 09:35

Visualize custom results in ParaView
 
Hi all,

I've written my own functionObject that is producing some results (scalar value) for each face of some specified patches that I save in a List<double>.

I would like to visualize these results in ParaView and my question is how?

I would guess that I need to save the result in some kind of field (e.g. surfaceScalarField) instead of a list to make this possible. If that's the case my next question is - how do I do that?

Thankful for any help on this!

Cheers,
david

sippanspojk December 12, 2019 04:28

Is there someone out there who knows how I can solve this problem?

I was starting to modify the pimpleFoam solver so it would create a custom field for me and I was at one point thinking that I should do all computations within the solver instead of in my functionObject. But then I realized that I will loose functionality that I need, e.g. being able to specify what patches that should be included in the computations. So I am pretty convinced that I should do this in a functionObject and then figure out a way to visualize this in ParaView.


I am really in need for help on this one!

cheers

akidess December 13, 2019 03:19

You can visualize any point field in ParaView. Just create a text data file with structure [X Y Z VALUE]. After loading the file, use the "Table to Points" filter to get a 3D render view of the point cloud data. To get a plane from the point cloud, use the "Delauney" filter.

sippanspojk December 13, 2019 06:04

Quote:

Originally Posted by akidess (Post 752330)
You can visualize any point field in ParaView. Just create a text data file with structure [X Y Z VALUE]. After loading the file, use the "Table to Points" filter to get a 3D render view of the point cloud data. To get a plane from the point cloud, use the "Delauney" filter.

Thank you so much, this is exactly what I need.

But a question - what is the exact format? Because I tried it out with a txt file whit the format "xCoord yCoord zCoord value" but it didn't work to convert from table to point. I could load the file in ParaView and the table looked as it should but I couldn't convert it.

I got the following messages in paraview:
"Failed to locate the columns to use for the point coordinates"

I guess it interperate the text file as a file with many rows and only one column?

EDIT:
I solved it by comma seperation and some other settings in ParaView.
I managed to plot the center point of each cell with it's corresponding value. I applied the Dulaney 2d Filter as you suggested and that basically created a mesh using the points. If I instead would like to use the initial mesh and give the same value as the center point to the whole face, how would I do that? Can I in a similar way define a face and a value in text format and convert table to face?


All times are GMT -4. The time now is 13:40.