CFD,  OpenFOAM

Installing OpenFOAM 1.7 on openSUSE 11.2

Installing OpenFOAM® 1.7 on openSUSE 11.2 is very similar to installing OpenFOAM 1.6.x, however some differences deserve to be noticed. 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 both the OpenFOAM and ThirdParty packages from here and save them in your ~/OpenFOAM directory
  • Extract the OpenFOAM-1.7.0.gtgz package with the command: tar xzf OpenFOAM-1.7.0.gtgz
  • Extract the ThirdParty-1.7.0.gtgz package with the command: tar xzf ThirdParty-1.7.0.gtgz
  • Open your ~/.bashrc file in a text editor and add the line:
    • . $HOME/OpenFOAM/OpenFOAM-1.7.0/etc/bashrc

    and source your ~/.bashrc file with the command: source ~/.bashrc

  • Enter the OpenFOAM-1.7.0 directory with the command: cd $FOAM_INST_DIR/OpenFOAM-1.7.0
  • Compile OpenFOAM with the command: ./Allwmake
  • Rebuild Paraview with the following commands:
    • cd $WM_THIRD_PARTY_DIR
    • ./Allclean
    • ./makeParaView
  • Rebuild the PV3FoamReader as follows:
    • cd $FOAM_UTILITIES/postProcessing/graphicsPV3FoamReader
    • ./Allwclean
    • ./Allwmake

This will rebuild the whole OpenFOAM and paraview, and provide you a fully working installation. However, the paraFoam does not work properly on my installation, so I compiled once again the very powerful and more flexible native reader available on the OpenFOAM wiki, which also allows easy post-processing of decomposed cases.

The instructions to compile the reader are as follows:

  • Download the SVN version of the reader, required for Paraview 3.8 (you need the svn package installed):
    • svn co https://of-interfaces.svn.sourceforge.net/svnroot/of-interfaces/trunk/vtkPOpenFOAMReader
  • I will assume you saved it in ~/vtkPOpenFOAMReader
  • 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
  • If OpenFOAM is properly configured, the build configuration will be written.
  • In the same terminal execute the commands
    • make
    • make install
  • Copy the file pvFoam in ~/vtkPOpenFOAMReader/BSD/ into your ~/OpenFOAM/OpenFOAM-1.7.0/bin directory, to be able to run paraview with pvFoam, exactly as done with paraFoam.
  • Refer to ~/vtkPOpenFOAMReader/readerPanel.pdf for details on the reader interface.
  • Note that both the temporary directories vtkReader and vtkPOpenFOAMReader can be removed.

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.

7 Comments

  • Higoro

    Hi,

    I tried your method but i keep getting an error message at the initial stage as shown below:

    bash: ~/OpenFOAM/OpenFOAM-1.7.0/etc/bashrc: No such file or directory

    What could be responsible for this error message?

    Thanks in advance.

    Regards,

    Higoro

  • Emre

    I’m really new at linux, I installed OpenSUSE to use OpenFOAM. So, I’d like to ask:
    Open your ~/.bashrc file in a text editor and add the line:

    * . $HOME/OpenFOAM/OpenFOAM-1.7.0/etc/bashrc

    and source your ~/.bashrc file with the command: source ~/.bashrc

    what do you mean exactly by these steps? i found bashrc under the “etc” folder. should i just open it and add the line?
    I tried to change the installation folder described in this file, but it didn’t work.

    By the way, thank you for your explanations. I hope I can manage installing this.

    • Alberto

      Hi Emre,

      ~/.bashrc

      is a short way to indicate

      /home//.bashrc

      If you do not have a .bashrc file in your home directory (it is a hidden file), you can create it, and add the line

      . $HOME/OpenFOAM/OpenFOAM-1.7.0/etc/bashrc

      to it, assuming the OpenFOAM directory is in your home.

  • Emre

    thank you.

    I managed to install it last night and to run the lid driven cavity tutorial using paraView. (p.s: ParaView works in 1.7.1 I guess, because I didn’t need to do the steps you described for the viewer)

    But now I have another problem. When I close my terminal and open again, all the installation is gone. Do I have to compile every time I open this? It takes almost an hour!

    Thank you. I really owe you so much..

    • Alberto

      Hello Emre,

      no, you do not have to recompile. When you close the terminal, you probably lose the OpenFOAM system settings. This probably indicates the .bashrc in your /home/ is not used. Try simply doing

      source $HOME/OpenFOAM/OpenFOAM-1.7.0/etc/bashrc

      or, if you added the line . $HOME/OpenFOAM/OpenFOAM-1.7.0/etc/bashrc to your .bashrc,

      source ~/.bashrc

      This should restore a working OpenFOAM environment.

      I hope this helps,
      Alberto

  • Vikas

    Hi,
    I am installing OpenFOAM 171 on OpenSUSE . I have successfully installed the software according to the instructions given on the site . However when i run icoFoam , the terminal shouts :
    “icoFoam: /lib/libc.so.6: version `GLIBC_2.11′ not found (required by /opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so)

    Acc to me , glibc is not installed properly . To overcome the prob i did a :
    “sudo zypper in -t pattern devel_C_C++

    which outputted :
    ” ‘devel_C_C++’ is already installed. ”
    Can you help me out in solving the error.

    • Alberto

      How did you install OpenFOAM? If you are using the RPM packages, and openSUSE 11.2, you cannot do that. RPM’s are only for openSUSE 11.3. You will have to compile the source code to have it working on openSUSE 11.2.