CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] paraview isolines (https://www.cfd-online.com/Forums/paraview/131115-paraview-isolines.html)

jasxxx March 9, 2014 11:48

paraview isolines
 
hi
is it possible to do isolines over a clipped surface, with the actual numbers on the isolines for pressure or velocity magnitude?
thanks
jas

wyldckat March 23, 2014 13:46

Greetings jas,

In ParaView, it's possible, but not easily done. The only two possible solutions I can find are:
  1. Coding a Programmable Filter in Python, using this code in C++ as reference: http://www.paraview.org/Wiki/VTK/Exa.../LabelContours
  2. Using matplotlib: http://www.kitware.com/blog/home/post/588
But probably the easiest is to export the isolines into a CSV file ("File -> Save Data", if I'm not mistaken) and then plot them elsewhere, such as with gnuplot.

You might also want to ask for this feature at ParaView's bug tracker and/or ParaView's UserVoice:

Best regards,
Bruno

wallace May 18, 2014 07:52

Hi Bruno,

I hope this doesn't seem to off-topic but this thread is the only hit for "matplotlib in ParaView" on the forum. Have you managed to build ParaView 4.1.0 and use the new matplotlib capabilities?

My installation:
OF23x on SL 6.5 largely following your excellent instructions over on the OpenFOAMWiki. For ParaView, I've set the python (and mesa) option to true in makeParaView4. Prior to build python 2.6.6, numpy 1.4.1 and python-matplotlib 0.99.1.2 were installed via yum. Qt 4.8.5 is built from source. Compiler is clang 3.3.

ParaView builds without error and python scripting features work fine, but if I try to open a "Python View" to do some matplotlib plots, I get the following error:

Code:

ERROR: In /home/william/OpenFOAM/ThirdParty-2.3.x/ParaView-4.1.0/ParaViewCore/ClientServerCore/Rendering/vtkMatplotlibUtilities.cxx, line 302
vtkMatplotlibUtilities (0x4940540): Could not call 'dpiCanvas.print_to_buffer()'


Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'inf' is not defined
ERROR: In /home/william/OpenFOAM/ThirdParty-2.3.x/ParaView-4.1.0/ParaViewCore/ClientServerCore/Rendering/vtkMatplotlibUtilities.cxx, line 302
vtkMatplotlibUtilities (0x4940540): Could not call 'pythonViewCanvas.print_to_buffer()'

Is some VTK dependency missing perhaps, or some configuration in the ParaView?

wallace May 18, 2014 09:38

Problem solved: removed SL python-matplotlib 0.99.1.2, built and installed matplotlib-1.2.0. (Thanks to Cory Kwammen at Kitware.)

javier_b October 31, 2014 03:56

1 Attachment(s)
Hi Jas,

I was looking for a similar solution and I came across your thread.

There is another possibility that hasn't been mentioned here… It is a bit tedious but the results are nice.

1. You need to have first the contour lines.
2. Make a slice over the contour lines you want to label (in order to make points)
3. Select the points you just created.
4. Open the selection inspector and make the label of the points “visible”.
5. You can choose the format of the float number (i.e. %.2f), the color, size etc..

Note: the picture attached uses a constant value just for illustration purposes.

This method has been taken from the following paraview thread:
http://public.kitware.com/pipermail/...er/018798.html

Regards,
Javier

nanavati February 19, 2015 06:15

Quote:

Originally Posted by javier_b (Post 516793)
Hi Jas,

I was looking for a similar solution and I came across your thread.

There is another possibility that hasn't been mentioned here… It is a bit tedious but the results are nice.

1. You need to have first the contour lines.
2. Make a slice over the contour lines you want to label (in order to make points)
3. Select the points you just created.
4. Open the selection inspector and make the label of the points “visible”.
5. You can choose the format of the float number (i.e. %.2f), the color, size etc..

Note: the picture attached uses a constant value just for illustration purposes.

This method has been taken from the following paraview thread:
http://public.kitware.com/pipermail/...er/018798.html

Regards,
Javier

Many thanks for sharing this info. it worked like a charm ! and i found it very easy compared to gnuplot and MATLAB.

ofbodur October 27, 2016 20:51

Non-steady isotherms/ Slice misfit
 
Hello,

The solution given here assumes that these contours will be steady. I have a simulation in which isotherms change during the model evolution, which means that slices will not fit in the isotherms for other time intervals. Is there any other way just to put the values of isotherms on the lines as we do in MATLAB?

Cheers

Omer


All times are GMT -4. The time now is 23:10.