CFD,  OpenFOAM

OpenFOAM 1.6.x on openSUSE 11.2 and VTK reader

Installing OpenFOAM® on openSUSE 11.2 is very easy, and can be done using, at least in part, the system tools, to take advantage of the new compiler. The steps of the procedure are the following:

  • Use YaST to install
  • Create a directory called OpenFOAM in your home directory
    • mkdir ~/OpenFOAM
  • Enter the OpenFOAM directory
    • cd ~/OpenFOAM
  • Download the OpenFOAM sources from the GIT repository
    • git clone git://repo.or.cz/OpenFOAM-1.6.x.git
  • Download the third party packages from the OpenCFD website
  • Extract the third party packages corresponding to your architecture in the ~/OpenFOAM directory
  • Rename the ThirdParty-1.6 into ThirdParty-1.6.x
  • Remove the following directories from the ThirdParty directory containing
    • cmake
    • gcc
  • Edit ~/OpenFOAM/OpenFOAM-1.6.x/etc/settings.sh to set
    • compilerInstall=System
  • Open your ~/.bashrc file in a text editor and add the line:
    • . $HOME/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc

    and source your ~/.bashrc file with the command (thanks to friesenjunge 🙂 )

    • source ~/.bashrc
  • Enter the ThirdParty-1.6.x directory
    • cd ~/OpenFOAM/ThirdParty-1.6.x
  • Rebuild Paraview with the following commands (you need qt4 development libraries installed in your system. Check the README file coming with OpenFOAM for a list of working versions)
    • rm -rf paraview-3.6.1/platforms
    • ./makeParaView
  • Enter the ~/OpenFOAM/OpenFOAM-1.6.x directory
    • cd ~/OpenFOAM/OpenFOAM-1.6.x
  • Rebuild OpenFOAM typing
    • ./Allwmake

This will rebuild the whole OpenFOAM and paraview, and provide you a fully working installation. However, the paraFoam reader might have some problem to properly show results in paraview. I could not solve them, however there is an alternative reader available on the OpenFOAM unofficial wiki, that can be compiled as follows. Note that the installation procedure assumes you have OpenFOAM 1.6.x installed and properly configured as explained above, and that paraview has been compiled successfully on your system.

  • Download the code from here.
  • Extract the archive in a directory of your choice. It is not important where, since the reader will be installed in your OpenFOAM tree. I will assume you extracted it in ~/vtkPOpenFOAMReader-r173-20090920
  • Create a directory where to build the reader. For convenience I will call it ~/vtkReader.
  • Open a terminal and enter that directory
    • cd vtkReader.
  • Type the command:
    • ccmake ~/vtkPOpenFOAMReader-r173-20090920
  • You will see a screen generated from cmake.  Simply press “c” to configure.
  • Another screen will appear with the following variables defined on the basis of your OpenFOAM installation
    • CMAKE_BUILD_TYPE
    • CMAKE_INSTALL_PREFIX
    • ParaView_DIR
  • Accept the proposal by pressing “g” to generate the configuration file and exit.
  • In the same terminal execute the commands
    • make
    • make install
  • Copy the file pvFoam in ~/vtkPOpenFOAMReader-r173-20090920/BSD/ into your ~/OpenFOAM/OpenFOAM-1.6.x/bin directory, to be able to run Paraview with pvFoam, exactly as done with paraFoam.
  • Refer to ~/vtkPOpenFOAMReader-r173-20090920/readerPanel.pdf for details on the reader interface.

Enjoy 🙂

This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trade marks.

21 Comments

  • Pradeep

    Hi Alberto,
    I am getting the following error while trying to install OpenFOAM. Can you give me some feedback. I have installed teh C++ pattern, cmake and libqt4-develop packages. I have done the git pull and followed the steps. When i try to make paraview i am getting the following error. Kindly help me out

    pradeep@linux-giny:~/OpenFOAM/ThirdParty-1.6.x> ./makeParaView
    did not find paraview- in these directories:
    PWD=/home/pradeep/OpenFOAM/ThirdParty-1.6.x
    WM_THIRD_PARTY_DIR=

    abort build
    pradeep@linux-giny:~/OpenFOAM/ThirdParty-1.6.x>

  • Emanuele

    how long compilation process takes on a Intel Dual-Core 1.86 Ghz? I’d like to know if i can compile OpenFoam with my laptop. Regards

    • Alberto

      Hi,

      yes, that’s correct. Sometime you might need to clean your installation before running ./Allwmake. In such a case you can use

      wcleanLnIncludeAll

      which might be sufficient, or

      wcleanAll

      and then ./Allwmake

  • friesenjunge

    regarding

    did not find paraview- in these directories:
    PWD=/home/pradeep/OpenFOAM/ThirdParty-1.6.x
    WM_THIRD_PARTY_DIR=

    you forget to load the environment variables
    . /home/yourname/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc

    hope this helps

    Cheers

    • Alberto

      Hi and thanks for your message. Actually the environment variables are set by the following step, which is essential to the build process:

      Open your ~/.bashrc file in a text editor and add the line:

      * . $HOME/OpenFOAM/OpenFOAM-1.6.x/etc/bashrc

      This line is identical to what you suggested, but does not depend on the username.
      About paraview, if you install both the general and platform-specific third-party packages, you should have paraview in your ThirdParty directory.

      Best,
      Alberto

  • friesenjunge

    Hi Alberto,

    my solution was posted under the impression that you wanted to carry out all the actions in one terminal session. For your solution one would have to logout and than login again, which seems to have lead to the error in the first place. Maybe you could just add a line saying “you have to login (best you close the terminal and start a new one to carry on) again for changes to take affect”

    Cheers and a happy new year to you,
    Steffen

  • Sebastian

    Hi Alberto!

    Thanks for your instructions. For me there is one question left:
    I ´m not sure what “Remove the following directories from the ThirdParty directory containing cmake gcc” actually means. In my case there is only a directory named “gcc-4.3.3” inside ~/OpenFOAM/Third-1.6.x/. Is this the only one that has to be deleted?

    Thanks in advance!

    Sebastian

  • Sebastian

    Thanks Alberto! Great work, the compilation was successful!

    Information for others:
    machine: 2 x AMD 2354 on Asus KFN32-D SLI 16 Gb RAM running with openSUSE 11.2 2.6.31.8-0.1-desktop

  • Krishna Ravi

    Sir Thank You very much for the detailed installation steps.I have also a remedy for paraview for the current installation

    First Installed paraview data from this site:

    http://teodori.org/repository/vtk/opensuse11.2/older/x86_64/paraview-data-3.6.1-2.x86_64.html

    Then I installed Paraview from this site

    http://teodori.org/repository/vtk/opensuse11.2/older/x86_64/paraview-data-3.6.1-2.x86_64.html

    Then I did the instructions given by you

    Than You very muchh for detailed steps and also best regards

    Krishna

  • David

    Thank You so much for this guide. It works and solve my problems with working with the binary files.

    Great job

    David

  • Simon

    Thanks a lot Alberto. Everything works fine now. I followed your guide, but had to do some extra work.

    After the Installation of OpenFoam I ran the FoamInstallationTest. The result was:

    WARNING: Conflicting installations:
    foam settings: /bin/gcc
    current path : /usr/bin/gcc
    CRITICAL ERROR

    To solve the problem I had to add “export WM_64=on” in the .bashrc file and “WM_COMPILER_DIR=/usr” after the “export WM_COMPILER_ARCH=” entry in the bashrc file in the OpenFOAM directory.

    Then when running paraFoam I got the error message: /home/OpenFOAM//OpenFOAM-1.6/bin/paraFoam: line 109: 22727 Abandon paraview –data=”$caseFile
    So besides your suggested VTK Reader I installed the PV3FoamReader according to the README of OpenFOAM. And now I have no error message and actually see results. Great! 🙂

  • hector

    when I do source ~/.bashrc
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/bin/foamCleanPath: No such file or directory
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/bin/foamCleanPath: No such file or directory
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/bin/foamCleanPath: No such file or directory
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/etc/settings.sh: No such file or directory
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/etc/aliases.sh: No such file or directory
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/etc/apps/paraview3/bashrc: No such file or directory
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/etc/apps/ensight/bashrc: No such file or directory
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/bin/foamCleanPath: No such file or directory
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/bin/foamCleanPath: No such file or directory
    -bash: /root/OpenFOAM/OpenFOAM-1.6.x/bin/foamCleanPath: No such file or directory

    Is it ok ?

    • Alberto

      Hi Hector,
      No it’s not correct 🙂

      Why do you have OpenFOAM in a directory called /root ? It should be in /home//OpenFOAM or you should specify the installation directory as explained in the README file.

      I would also check if those files are present in the directory tree of OpenFOAM, after you extract the files.

      Best,
      Alberto

  • hector

    I have this problem to run foamInstallationTest
    gcc 4.4.1
    WARNING: Conflicting installations:
    OpenFOAM settings : /bin/gcc
    current path : /usr/bin/gcc
    CRITICAL ERROR

    gzip 1.3.12 /usr/bin/gzip
    tar 1.21 /bin/tar
    icoFoam
    WARNING: Conflicting installations:
    OpenFOAM settings : /root/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt/icoFoam
    current path :
    CRITICAL ERROR

    • Alberto

      You have a conflict in your installation according to that test. What happens when you try to run icoFoam on its tutorial?

  • Michael

    Thank you Alberto for your installation guide, especially the one for paraview. I tried the whole day installing paraview with the openfoam’s own reader but it didnt work. Then I found your guidelines and the compilation worked with no problems.
    Greetings, Michael (old friend of Jaswi)

  • Toni

    I followed your instructions and successfully compiled OF.
    Unfortunately when I type “paraFoam” i get: /home/kressnt/OpenFOAM/OpenFOAM-1.6.x/bin/paraFoam: Line 133: paraview: commando not found.