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
-
Hi Tobias,
You're welcome!
Quote:
Although I advise you to not close the editor until you've tested the script, so you can undo if necessary
Best regards,
BrunoPosted July 26, 2012 at 16:35 by wyldckat -
Hi Bruno,
I searched through "paraFoam" and found additional places whereas I had to change OpenFOAM to foam. So now the "paraFoam" script works very well.
Thanks Bruno for solving the problem.
Best Regards,
TobiasPosted July 26, 2012 at 22:50 by tobias.joelsson