Using the official pre-built ParaView 3.10.1 version with OpenFOAM
Posted April 30, 2011 at 08:16 by wyldckat
Updated May 4, 2013 at 07:46 by wyldckat (Updated to reflect changes in OpenFOAM 2.0)
Updated May 4, 2013 at 07:46 by wyldckat (Updated to reflect changes in OpenFOAM 2.0)
<-- Related issues to ParaView with OpenFOAM - Fixes and solutions
NOTE: For building your own ParaView see Building ParaView 3.10.1 with custom Qt 4.6.4
_________________________________________________
After limited success with the old instructions "Using the official pre-built ParaView 3.8.0 version with OpenFOAM...", I've decided to write a new blog post, instead of editing the old one. Hopefully these instructions no longer will have the issues that occurred with those instructions.
NOTE: these instructions should also work with past and future versions of ParaView. You'll need to adapt version numbers for ParaView, such as 3.10.1 -> 3.10.2 or 3.8.1.
Keep in mind that versions before 3.8.0 are not acceptable with these instructions, since the internal reader can't read meshes from OpenFOAM versions above 1.2, if I'm not mistaken.
The instructions are as follows:
By the way, some additional tips:
Good luck! Best regards,
Bruno
NOTE: For building your own ParaView see Building ParaView 3.10.1 with custom Qt 4.6.4
_________________________________________________
After limited success with the old instructions "Using the official pre-built ParaView 3.8.0 version with OpenFOAM...", I've decided to write a new blog post, instead of editing the old one. Hopefully these instructions no longer will have the issues that occurred with those instructions.
NOTE: these instructions should also work with past and future versions of ParaView. You'll need to adapt version numbers for ParaView, such as 3.10.1 -> 3.10.2 or 3.8.1.
Keep in mind that versions before 3.8.0 are not acceptable with these instructions, since the internal reader can't read meshes from OpenFOAM versions above 1.2, if I'm not mistaken.
The instructions are as follows:
- Start a new terminal and activate the OpenFOAM environment if not already active. For more information, see Setting Environment Variables
- For example, if you have installed OpenFOAM 1.7.1 using the Deb packages for Ubuntu, then this means that you need to switch to root mode and activate the respective environment. A quick way to do this is by running:
Code:sudo su -c "source /opt/openfoam171/etc/bashrc; bash"
Code:exit
- For example, if you have installed OpenFOAM 1.7.1 using the Deb packages for Ubuntu, then this means that you need to switch to root mode and activate the respective environment. A quick way to do this is by running:
- Check if you already have something installed in paraview's binary folder:Code:
ls $ParaView_DIR
Code:rm -rf $ParaView_DIR
- Now run:Code:
cd $HOME/OpenFOAM mkdir -p $ParaView_DIR
- Now, depending on the architecture you are running on your Linux box (i?86 or x86_64), run one of these commands:
- For i?86:Code:
wget http://www.paraview.org/files/v3.10/ParaView-3.10.1-Linux-i686.tar.gz
- For x86_64:Code:
wget http://www.paraview.org/files/v3.10/ParaView-3.10.1-Linux-x86_64.tar.gz
- For i?86:
- Now do:Code:
cd $ParaView_DIR
- Again, depending on what architecture you are using, do:
- For i?86:Code:
tar -xzf $HOME/OpenFOAM/ParaView-3.10.1-Linux-i686.tar.gz mv ParaView-3.10.1-Linux-i686/* . rmdir ParaView-3.10.1-Linux-i686
- For x86_64:Code:
tar -xzf $HOME/OpenFOAM/ParaView-3.10.1-Linux-x86_64.tar.gz mv ParaView-3.10.1-Linux-x86_64/* . rmdir ParaView-3.10.1-Linux-x86_64
- For i?86:
- Now open the file "$WM_PROJECT_DIR/bin/paraFoam" in your favorite simple text editor and replace every entry ".OpenFOAM" with ".foam". Now save and close the file.
NOTE: if you're feeling too lazy to open a text editor, try this:Code:sed -i -e 's=\.OpenFOAM=\.foam=' $WM_PROJECT_DIR/bin/paraFoam
Code:paraFoam -builtin
- Edit the file "$WM_PROJECT_DIR/etc/bashrc" and find the line that says:
- In OpenFOAM 1.7:
Code:paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc` \ && _foamSource $paraview3 unset paraview3
Code:#paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc` \ # && _foamSource $paraview3 #unset paraview3
- In OpenFOAM 2.0:Code:
# Source user setup files for optional packages # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.sh`
Code:# Source user setup files for optional packages # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.sh`
- In OpenFOAM 1.7:
- Next, edit again the script "$WM_PROJECT_DIR/bin/paraFoam". Go to the line right after the first block of comments and add the lines that were commented in "$WM_PROJECT_DIR/etc/bashrc", although with a little tweak. With the tweak, it should look something like this (bold is the new addition):
- OpenFOAM 1.7:Code:
# Description # start paraview with the OpenFOAM libraries # #------------------------------------------------------------------------------ paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc` \ && source $paraview3 unset paraview3 usage() {
- OpenFOAM 2.0:Code:
# Description # Run an OpenFOAM job in background. # Redirects the output to 'log' in the case directory. # #------------------------------------------------------------------------------ paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh` \ && source $paraview3 unset paraview3 usage() {
- OpenFOAM 1.7:
- Start a new terminal once again and activate the OpenFOAM environment if not already active.
By the way, some additional tips:
- If you are having problems with rescaling data (the colour labels) in ParaView, you might have tripped on a now known bug in ParaView 3.8.0, which I haven't checked yet if it was fixed in 3.10. To get past this, read this post (and its thread): paraview 3.8 auto rescale doesn't work #6
- Usual problems with ParaView and some hints on how to fix them: Segmentation fault when visualizing in ParaView
- ParaFoam error could not find a decent visual - solution in post #4
Good luck! Best regards,
Bruno
Total Comments 22
Comments
-
This worked for me except that after the "paraFoam" command the program is still confused about the data format - so I have to choose OpenFOAM manually.
But worse it totally get's confused with the multiRegionFoam tutorial. Instead of reading constant/polyMesh/boundary it tries for constant/heater/polyMesh/boundary and then causes an error..
Any ideas?Posted July 1, 2011 at 11:28 by jofry -
Greetings Jofry,
You could have said which OpenFOAM version you are using The only idea I get is what has already been reported here: http://www.cfd-online.com/Forums/ope...tml#post313489
In other words, things have changed a bit with OpenFOAM 2.0.0, so expect things not to work as expected with the internal reader
By the way, which Linux distribution and version are you using? It's possible that it'll be easier to build ParaView now than it was a year ago!
Best regards,
BrunoPosted July 2, 2011 at 06:05 by wyldckat -
Hi jofry,
That is the same issue to the one to which wyldckat provided the link, and has been filed as a bug with a proposed fix in the ParaView bug tracker.
http://paraview.org/Bug/view.php?id=12318
TakuyaPosted July 4, 2011 at 23:19 by 7islands -
Hi Bruno, hi Takuya,
thanks for your support!!
for the record: I tried openfoam 2.0 with paraview 3.10.1 on ubuntu 10.10 and 11.04
Looking at the links and it struck me:
I have no thirdparty software installed.. With openfoam 1.7.x i didn't need to - I just executed apt-get install openfoam 1.7.1 - (I'm not certain if I tried the multRegionFoam though).
Now I downloaded it from the Git Repository but I'm not exactly sure how to make it work..
Thanks again!!Posted July 12, 2011 at 09:43 by jofry -
Hi Jofry,
If you are installing from the git repo, simply follow the whole and completely official instructions to the letter: http://www.openfoam.com/download/git.php
Hopefully all will work well if you follow those instructions properly
Failing that, here are at least a few threads you read and can check for more information:
- A must read: http://www.openfoam.com/mantisbt/view.php?id=239
- OpenFoam 2.0.0 installation
- OpenFOAM 2.0.x libscotch issues
- Compilation error OF 2.0.x (UIPstream)
Best regards and good luck!
BrunoPosted July 12, 2011 at 19:24 by wyldckat -
Hi Takuya!
Many thanks for the cross-reference to that bug report! That will come in handy soon enough
Best regards,
BrunoPosted July 12, 2011 at 19:25 by wyldckat -
Thanks!!!!
Posted July 20, 2011 at 12:58 by ulisses -
Hi Bruno,
Greetings!!
Thanks for the method you gave to make paraview work for OF2.0. Although when I followed these steps for OpenFoam 2.0.x (centFoam) the paraview works fine, but now my 'gedit' command stopped working. On execution it says "Segmentation fault (core dumped). When I undid the step no. 8 (i.e. unhashed the '_foamsource..... paraview.sh' line) gedit again started working. Can you tell me any reason for this. FYI I installed centFOAM 2.0.x on RHEL 6.0 x64_86 and followed your above steps to build paraview.
Thanks in advance!!
ManojPosted July 21, 2011 at 07:31 by run_cfd -
Greetings Manoj,
Mmm interesting... two possibilities come to mind:
- You might have forgotten to start a new terminal after commenting that line in bashrc.
- Or config/paraview.sh might do something beneficial.
The only beneficial detail I can think of is that the libraries that come with the pre-built ParaView version are more compatible with your system's gedit than some other library that is available with CentFOAM, most likely one of the libraries that come with CentFOAM's gcc version. This would be because of this line of code in config/paraview.sh:Code:export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-$ParaView_MAJOR:$LD_LIBRARY_PATH
Code:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ParaView_DIR/lib/paraview-$ParaView_MAJOR
Best regards,
BrunoPosted July 22, 2011 at 18:50 by wyldckat -
Hi
Seeing that everyone is talking about Paraview 3.10.1, has anyone experienced a segmentation fault when making a screenshot in Paraview, as explained in the following bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=542391
I'm running OpenFoam 2.0.1 on Ubuntu 10.10, and used the standard ubuntu repository install. I had Paraview 3.8.0 working perfectly before. Tried going the foamToVTK route but no luck either. Any suggestions/solutions?
Thanks
CasePosted August 17, 2011 at 10:22 by case -
Which build exactly?
Greetings Case,
It would help if you also let us know which ParaView build are you actually using now, which leads to the segmentation fault. Is it:
- The one from here: http://www.openfoam.com/download/ubuntu.php
- The one from www.paraview.org, as explained in this blog post.
- Or did you build it from source?
Quote:Usual problems with ParaView and some hints on how to fix them: Segmentation fault when visualizing in ParaView
Best regards,
BrunoPosted August 17, 2011 at 14:25 by wyldckat -
Sorry about the delay.
I'm using the ParaView build as mentioned in a) http://www.openfoam.com/download/ubuntu.php
Let me read through your blog post and try everything mentioned there, and see if I can get it to work. Have gone back to OF 1.7.1 and ParaView 3.8.0 in the meantime.
Thanks for your time!
Regards
CasePosted August 25, 2011 at 09:00 by case -
thanks for help.
Posted November 29, 2011 at 20:18 by aminakis -
Hi Bruno,
thank you for the good tutorial 'Using the official pre-built ParaView 3.10.1 version with OpenFOAM ' for installing paraView
I running OpenFOAM 2.0.0 with paraView 3.10.1
with cmake version 2.8.7 cmake 2.8.7-0ubuntu4
My problem is that paraFoam command does not work. When I write paraFoam within a OpenFOAM run case this is the error message:
/home/tobias/OpenFOAM/OpenFOAM-2.0.0/bin/paraFoam:
42: /home/tobias/OpenFOAM/OpenFOAM-2.0.0/bin/paraFoam: source: not found
created temporary 'aachenBomb.OpenFOAM'
/home/tobias/OpenFOAM/OpenFOAM-2.0.0/bin/paraFoam:
244: /home/tobias/OpenFOAM/OpenFOAM-2.0.0/bin/paraFoam: paraview: not found
Thanks!
Best Regards,
TobiasPosted July 20, 2012 at 02:53 by tobias.joelsson -
Hi Tobias,
Did you do the step #9, the one specific to OpenFOAM 2.0?
What happens if you run this command:
Code:$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh
Code:echo $WM_PROJECT_DIR
BrunoPosted July 20, 2012 at 09:40 by wyldckat -
Hi Bruno,
First, thanks for you replying my question.
Yes, I did step 9, there I in my home dir:
Code:/home/tobias/OpenFOAM/OpenFOAM-2.0.0/bin/paraFoam
Code:paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh` \ && source $paraview3 unset paraview3
Code:$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh
Code:/home/tobias/OpenFOAM/OpenFOAM-2.0.0/etc/config/paraview.sh
Code:echo $WM_PROJECT_DIR
Code:/home/tobias/OpenFOAM/OpenFOAM-2.0.0
TobiasPosted July 22, 2012 at 21:14 by tobias.joelsson -
Hi Tobias,
I forgot to ask before, but what do these commands do for you:
Code:ls -l /home/tobias/OpenFOAM/OpenFOAM-2.0.0/etc/config/paraview.sh which source source /home/tobias/OpenFOAM/OpenFOAM-2.0.0/etc/config/paraview.sh
- Check if the file does exist or not.
- Checks if source doesn't have a double meaning, i.e. it might also be an application, which it shouldn't be.
- Tests if what paraFoam first complain about does or not occur directly in the command line.
BrunoPosted July 23, 2012 at 18:32 by wyldckat -
Hi Bruno,
First when I write in line
ls -l /home/tobias/OpenFOAM/OpenFOAM-2.0.0/etc/config/paraview.sh
is my reply:
Code:-rw-rw-r-- 1 tobias tobias 4153 Jul 20 15:51 /home/tobias/OpenFOAM/OpenFOAM-2.0.0/etc/config/paraview.sh
source /home/tobias/OpenFOAM/OpenFOAM-2.0.0/etc/config
does not reply anything in Terminal
1. Check if the file does exist or not.
Yes paraview.sh exist inCode:/home/tobias/OpenFOAM/OpenFOAM-2.0.0/etc/config/paraview.sh
2. Checks if source doesn't have a double meaning, i.e. it might also be an application, which it shouldn't be.
I do not really get where I should look for source? In which file?
3. Tests if what paraFoam first complain about does or not occur directly in the command line.
tested in libCode:/home/tobias/OpenFOAM/tobias-2.0.0/run/tutorials/incompressible/icoFoam/1-cavity
Code:/home/tobias/OpenFOAM/OpenFOAM-2.0.0/bin/paraFoam: 54: /home/tobias/OpenFOAM/OpenFOAM-2.0.0/bin/paraFoam: source: not found created temporary '1-cavity.OpenFOAM' /home/tobias/OpenFOAM/OpenFOAM-2.0.0/bin/paraFoam: 257: /home/tobias/OpenFOAM/OpenFOAM-2.0.0/bin/paraFoam: paraview: not found
TobiasPosted July 25, 2012 at 02:34 by tobias.joelsson -
Hi Tobias,
OK, I think I managed to figure it out: your sh shell is a non-conventional one. That is why the source command won't work the way it's meant to. The source command is an internal command in the shell, which in your case either doesn't work this way or doesn't exist.
The quickest fix is to edit the paraFoam script again and change in the first line:
Code:#!/bin/sh
Code:#!/bin/bash
Best regards,
BrunoPosted July 25, 2012 at 15:33 by wyldckat -
Thank you Bruno!
Great it solve the problem...
But when I run paraFoam it act strange, I got a bug that generate a temporary .OpenFOAM file when it (after your guide point 7.) should generate a .foam file
It cause me some minor problem, to I have to manually reload the .foam file in to paraView.
Is there somewhere else in paraFoam that I have forgot to change from .OpenFOAM to .foam?
Best Regards, and Thanks again for finding the problem with made paraFoam run.
TobiasPosted July 26, 2012 at 06:02 by tobias.joelsson