CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

Using the official pre-built ParaView 3.8.0 version with OpenFOAM...

Register Blogs Community New Posts Updated Threads Search

Rating: 2 votes, 5.00 average.

Using the official pre-built ParaView 3.8.0 version with OpenFOAM...

Posted July 17, 2010 at 16:19 by wyldckat
Updated September 5, 2011 at 06:17 by wyldckat (Generalized instructions for any version of OpenFOAM; now with sed :D And some more adjustments and instructions)

<-- Related issues to ParaView with OpenFOAM - Fixes and solutions


NOTE - New instructions available here: Using the official pre-built ParaView 3.10.1 version with OpenFOAM
NOTE 2: Instructions for doing a custom build: Building ParaView 3.8.0 with custom Qt 4.6.3

_________________________________________________
Greetings to all!

[When this post was first written] Less than a month ago OpenFOAM 1.7.0 was released. With it also came ParaView 3.8.0, which is currently also available at www.paraview.org.

This blog post comes to try and help new (and old) users of OpenFOAM to quickly get ParaView 3.8.0 working with OpenFOAM 1.7.0, without having to go through the somewhat hazardous building procedure that it currently looks like it to be...
I hope that this should work for any Linux distribution for x86/x86_64 based architectures.

NOTE: these instructions should also work with future versions of ParaView. You'll need to adapt version numbers for ParaView, such as 3.8.0 -> 3.8.1 or 3.9.0.

So, the steps are as follows:
  1. Start a new terminal (and activate the OpenFOAM environment if not already active).
  2. Check if you already have something installed in paraview's binary folder:
    Code:
    ls $ParaView_DIR
    If it doesn't say something like "ls: cannot access /home/..../paraview-3.8.0: No such file or directory", then remove the folder:
    Code:
    rm -rf $ParaView_DIR
  3. Now run:
    Code:
    cd $HOME/OpenFOAM
    mkdir -p $ParaView_DIR
  4. Now, depending on the architecture you are running on your Linux box (i?86 or x86_64), run one of these commands:
    1. For i?86:
      Code:
      wget http://www.paraview.org/files/v3.8/ParaView-3.8.0-Linux-i686.tar.gz
    2. For x86_64:
      Code:
      wget http://www.paraview.org/files/v3.8/ParaView-3.8.0-Linux-x86_64.tar.gz
  5. Now do:
    Code:
    cd $ParaView_DIR
  6. Again, depending on what architecture you are using, do:
    1. For i?86:
      Code:
      tar -xzf $HOME/OpenFOAM/ParaView-3.8.0-Linux-i686.tar.gz
      mv ParaView-3.8.0-Linux-i686/* .
      rmdir ParaView-3.8.0-Linux-i686
    2. For x86_64:
      Code:
      tar -xzf $HOME/OpenFOAM/ParaView-3.8.0-Linux-x86_64.tar.gz
      mv ParaView-3.8.0-Linux-x86_64/* .
      rmdir ParaView-3.8.0-Linux-x86_64
  7. 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
  8. Edit the file "$WM_PROJECT_DIR/etc/bashrc" and find the line that says:
    Code:
    paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc` \
        && _foamSource $paraview3
    unset paraview3
    Now comment it, like this:
    Code:
    #paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc` \
    #    && _foamSource $paraview3
    #unset paraview3
    Save and close the file.
  9. 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):
    Code:
    # Description
    #     start paraview with the OpenFOAM libraries
    #
    #------------------------------------------------------------------------------
    paraview3=`$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc` \
        && source $paraview3
    unset paraview3
    
    usage() {
    Save and close. I'm sorry, but I don't know yet how to create the lazy edit version
  10. Start a new terminal once again and activate the OpenFOAM environment if not already active.
And voilá, you now should have a fully working paraFoam script at your disposal! Along with ParaView 3.8.0, with no further building required



By the way, some additional tips:
  1. If your Linux installation isn't in English, then you better follow these instructions:
    Edit again the file paraFoam and add this line right after the first block of comments:
    Code:
    export LC_ALL=C
    Save and close.
  2. 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. To get past this, read this post (and its thread): paraview 3.8 auto rescale doesn't work #6
  3. Usual problems with ParaView and some hints on how to fix them: Segmentation fault when visualizing in ParaView
  4. ParaFoam error could not find a decent visual - solution in post #4

Good luck! Best regards,
Bruno
« Prev     Main     Next »
Total Comments 16

Comments

  1. Old Comment
    Thanks!!
    You help me a lot.
    permalink
    Posted September 5, 2010 at 13:04 by ulisses ulisses is offline
  2. Old Comment
    Thanks!!! Works great. I have saved plenty of time on debugging the compilation.
    Do you know how to make OpenFoam reader default? The window on paraView start-up.
    permalink
    Posted October 15, 2010 at 11:50 by kprzysowagmailcom kprzysowagmailcom is offline
  3. Old Comment
    Hi kprzysowagmailcom,

    Did you read the point 7
    Quote:
    7. 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.
    For example, run in your terminal:
    Code:
    gedit $WM_PROJECT_DIR/bin/paraFoam
    Best regards,
    Bruno
    permalink
    Posted October 15, 2010 at 11:57 by wyldckat wyldckat is offline
    Updated October 15, 2010 at 11:58 by wyldckat (added example)
  4. Old Comment
    This helped me a lot, thank you. Replacing .OpenFOAM by .foam got rid of the "assertion 'extent !=0' failed" that I got when running paraFoam from a case dir. Now I believe I can finally run the first tutorial example of OpenFOAM in its full glory. :')
    permalink
    Posted December 14, 2010 at 06:55 by Aneirin Aneirin is offline
  5. Old Comment
    sahm's Avatar
    Hi, I created the following note which is very similar to your notes above. sorry I understood this better
    It says the same thing, the only difference is that it is the same for all architectures and linux versions ( not sure about that ). And this installs the paraview in the main OpenFOAM folder, so that it would be the same paraview for all OF versions, if you have several versions (like 1.5 , 1.5.x , 1.6 , 1.7) on your computer simultaneously, you just have to do the step 1 and 2 for each version, after calling that version.
    I'm trying to make a shell script to do everything automatically. Should you need the script, don't hesitate to contact.

    Thank You Wyldckat for your good note. you can edit your notes and remove mine.

    1- Remove The Old ParaView Folder. This folder is usually set with OpenFOAM Installation.
    The following file defines every parameter regarding ParaView and ParaFOAM:
    $WM_PROJECT_DIR/etc/apps/paraview3/bashrc
    and this file is sourced from main OpenFOAM bashrc file:
    $WM_PROJECT_DIR/etc/bashrc
    1. Look if Old ParaView Folder exists:
      Code:
              ls $ParaView_DIR
    2. If it says something like
      Quote:
      ls: cannot access /home/..../paraview-3.8.0: No such file or directory
      , that means the ParaView Folder does not exist and no need to clear it, as that gives error message.
      If it doesn't say something like that , then remove the folder:
    Code:
            rm -rf $ParaView_DIR
    2- Change the ParaView bashrc file:
    $WM_PROJECT_DIR/etc/apps/paraview3/bashrc
    set the paraview version and folders by finding the similar lines and changing to new version and folders:
    ParaView_VERSION=3.8.1
    paraviewInstDir=$WM_PROJECT_INST_DIR/ParaView-$ParaView_VERSION-Linux-$KUSU_DIST_ARCH
    export ParaView_DIR=$WM_PROJECT_INST_DIR/ParaView-$ParaView_VERSION-Linux-$KUSU_DIST_ARCH
    3- Set the ParaView Reader format inside paraFoam command:
    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.
    The following code does the same thing:
    Code:
            sed -i -e 's=\.OpenFOAM=\.foam=' $WM_PROJECT_DIR/bin/paraFoam
    4- Download and Unpack latest version of Paraview with the following Code ,which does it automatically:

    Code:
    wget http://www.paraview.org/files/v3.8/ParaView-$ParaView_VERSION-Linux-$KUSU_DIST_ARCH.tar.gz
            tar -xzf ParaView-$ParaView_VERSION-Linux-$KUSU_DIST_ARCH.tar.gz
    5- Move the Downloaded files into the ParaView Installation Folder:
    Code:
    mv ParaView-$ParaView_VERSION-Linux-$KUSU_DIST_ARCH/ $WM_PROJECT_INST_DIR/
    permalink
    Posted January 14, 2011 at 03:13 by sahm sahm is offline
  6. Old Comment
    sahm's Avatar
    Interesting Problem occured:
    I did what I've written above, and parafoam works,
    but other openfoam programs don't work as I get the following message:
    blockMesh: /home/sahm/OpenFOAM/ParaView-3.8.1-Linux-x86_64/lib/paraview-3.8/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /home/sahm/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt/libfiniteVolume.so)
    and many other things. any idea for that?
    permalink
    Posted January 14, 2011 at 04:07 by sahm sahm is offline
  7. Old Comment
    Hi Sahm,

    I'm sorry for taking so long to reply to you, but I didn't receive any email from cfd-online server when you posted the comments

    OK, first thing, the following command tells you if you have i?86 or x86_64:
    Code:
    uname -m
    The variable "KUSU_DIST_ARCH" will only work for your Linux distribution. I've gotta fix my blog post to make it a bit more easy to understand.

    Second thing, the error you got at the end, happened to me today as well - this is why I only saw your comments today!!
    The fix is quite simple:
    1. Make sure that a certain line in "$WM_PROJECT_DIR/bin/apps/paraview3/bashrc" is like this:
      Code:
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ParaView_DIR/lib/paraview-$ParaView_MAJOR
      This will make sure that ParaView's libraries don't stand in the way.
    2. Make sure which architecture your system is, by running:
      Code:
      uname -m
    3. Now, edit the file "$HOME/.bashrc" file. Now, this is where things get a bit confusing:
      • Search for the first line where you placed something related to OpenFOAM.
      • Now, before that first line, put this line before it, depending on your architecture - for i?68:
        Code:
        #For i?68
        export LD_LIBRARY_PATH=/lib:/usr/lib:$LD_LIBRARY_PATH
        For x86_64:
        Code:
        #For x86_64
        export LD_LIBRARY_PATH=/lib64:/usr/lib64:$LD_LIBRARY_PATH
      Save and close.
    4. Start a new terminal. If necessary, activate the OpenFOAM environment. And test if all is working!
    If it still isn't working, then there is something very strange going on. Check if the folders "/lib" and "/usr/lib" or "/lib64" and "/usr/lib64" exist in your system. If not, then check the other pair of folders and fix accordingly!

    Best regards,
    Bruno
    permalink
    Posted January 25, 2011 at 19:49 by wyldckat wyldckat is offline
  8. Old Comment
    Hello Bruno,

    Just a comment, my system (Scientific Linux 5.5 64 bit) this line does not exist: "$WM_PROJECT_DIR/bin/apps/paraview3/bashrc".

    Instead, I have "$WM_PROJECT_DIR/etc/apps/paraview3/bashrc". Edited this file as you suggested above and blockMesh works.

    Thank you for your post and insight.
    permalink
    Posted February 9, 2011 at 18:57 by namCFD namCFD is offline
  9. Old Comment
    Hi Nam,
    Quote:
    Originally Posted by namCFD View Comment
    Just a comment, my system (Scientific Linux 5.5 64 bit) this line does not exist: "$WM_PROJECT_DIR/bin/apps/paraview3/bashrc".

    Instead, I have "$WM_PROJECT_DIR/etc/apps/paraview3/bashrc". Edited this file as you suggested above and blockMesh works.

    Thank you for your post and insight.
    Nice catch!! And it's the same for any system as well
    I'll fix it right away before I forget to fix it...

    And you're welcome

    Best regards,
    Bruno
    permalink
    Posted February 9, 2011 at 20:19 by wyldckat wyldckat is offline
  10. Old Comment
    maysmech's Avatar

    paraview cause folders opening problem

    Dear Bruno,
    Thanks for your comments. now my paraFoam works properly.
    permalink
    Posted February 24, 2011 at 05:48 by maysmech maysmech is offline
    Updated February 24, 2011 at 07:13 by maysmech
  11. Old Comment
    Hello,

    Is this procedure useful even for OpenFOAM 2.0.x with Paraview 3.10.1?
    In the step 2, you mentioned if it doesn't say something like this "blah blah blah" then remove the directory and go to step 3. But when I type ls $Paraview_DIR, it gives me that line, so what should I do next? do I have to still remove the folder?

    Thank you
    permalink
    Posted August 24, 2011 at 12:23 by vetnav vetnav is offline
  12. Old Comment
    Hi Naveen,

    You must be getting very stressed out Didn't you read the top of this blog post?
    Quote:
    I also have another blog post for building ParaView: Building ParaView 3.10.1 with custom Qt 4.6.4

    edit: I forgot to mention that if the folder does exist in step 2, then do remove it!

    Best regards and good luck!
    Bruno
    permalink
    Posted August 24, 2011 at 17:01 by wyldckat wyldckat is offline
    Updated August 24, 2011 at 17:03 by wyldckat (see "edit:")
  13. Old Comment
    Hi Bruno,

    Thank you for the reply. I installed OpenFOAM 2.0.x, and I overlooked the instructions for Paraview 3.10.1. So I installed paraview and used foamtoVTK. Now I will try the above thread.

    You are right I am stressed out even though I felt happy after 2.0.x installed properly, after running a test case I closed my konsole, when I try to open a new konsole, it didn't respon. I restarted the computer and tried again, to my dismay nothing seems working, konsole, editors and other fedora applications are not responding. So I am still struggling

    Thank you again for your time
    Naveen
    permalink
    Posted August 24, 2011 at 21:15 by vetnav vetnav is offline
  14. Old Comment
    Hi Naveen,

    Oh !"#$%&... You must remove this ParaView pre-built version!! It carries it's own Qt and maybe libc or stdc++ and that's why your Fedora applications stopped working
    Sorry about that... sometimes it's a hit and miss with these pre-built things You better build your own ParaView instead!

    Best regards and good luck!
    Bruno
    permalink
    Posted August 25, 2011 at 04:33 by wyldckat wyldckat is offline
  15. Old Comment
    Hello,
    I have some questions regarding ParaView:

    1. How to re_built ParaView 3.12.0?

    2. Do we need to install a third-party 2.2.1 with OpenFoam 2.2.1 or ParaFOAM is enough for OpenFOAM 2.2.1 to work properly?

    3.When I apply the cavity case in paraView 3.12.0 the Apply icom is not activating, what's the problem?

    Help me please to answer these three questions.

    Many thanks
    permalink
    Posted October 13, 2013 at 13:42 by Maimouna Maimouna is offline
  16. Old Comment
    Hi Maimouna,

    Quote:
    Originally Posted by Maimouna View Comment
    1. How to re_built ParaView 3.12.0?
    Why do you want to rebuild ParaView? According to this post: http://www.cfd-online.com/Forums/ope...tml#post456364 post #10 - you installed the one supplied for OpenFOAM, correct?

    Quote:
    Originally Posted by Maimouna View Comment
    2. Do we need to install a third-party 2.2.1 with OpenFoam 2.2.1 or ParaFOAM is enough for OpenFOAM 2.2.1 to work properly?
    paraFoam is a convenience script that opens an OpenFOAM case in ParaView. Therefore, if paraFoam works, then ParaView is working.

    Quote:
    Originally Posted by Maimouna View Comment
    3.When I apply the cavity case in paraView 3.12.0 the Apply icom is not activating, what's the problem?
    By the way, there is a dedicated sub-forum for these kinds of questions, namely this one: http://www.cfd-online.com/Forums/openfoam-paraview/
    So, please open a new thread on that sub-forum and please describe in detail what steps you've taken and please provide a snapshot of what you're seeing.

    Best regards,
    Bruno
    permalink
    Posted October 13, 2013 at 15:37 by wyldckat wyldckat is offline
 

All times are GMT -4. The time now is 05:34.