Ubuntu/Debian pack installation

Ubuntu/Debian pack installation

Version 1.7.1, released 26/08/10

Ubuntu versions

OpenFOAM and Paraview are currently available for the following versions of Ubuntu:

  • 10.04 LTS, codename lucid

Installation

OpenFOAM and Paraview can be simply installed using the apt package management tool.

  1. In a terminal window, first get superuser privileges using sudo by typing:

            sudo su
        
  2. Add OpenFOAM to the list of repository locations for apt to search by adding an entry to the /etc/apt/sources.list file (this only needs to be done once for a given system).

            echo "deb http://www.openfoam.com/download/ubuntu lucid main" >> /etc/apt/sources.list
        
  3. Update the apt package list to account for the new download repository location

            apt-get update
        
  4. Install OpenFOAM (171 in the name refers to version 1.7.1):

            apt-get install openfoam171
        
  5. Install Paraview (380 in the name refers to version 3.8.0):

            apt-get install paraviewopenfoam380
        
  6. OpenFOAM is now installed. Exit the superuser account by typing:

            exit
        

User configuration

In order to use the installed OpenFOAM package, complete the following

  1. Open the .bashrc file in the user’s home directory in an editor, e.g. by typing in a terminal window (note the dot)

            gedit ~/.bashrc
        
  2. At the bottom of that file, add the following line † \relax \special {t4ht= (note the dot) and save the file

            . /opt/openfoam171/etc/bashrc
        
  3. This change to the .bashrc file will be

            . ~/.bashrc
        
  4. Open a new‡ \relax \special {t4ht= terminal window and test that the icoFoam application, from the OpenFOAM package, is working by typing

            icoFoam -help
        
  5. A “Usage” message should appear. Your installation and user configuration is complete.

Notes:
† \relax \special {t4ht= If a similar line has already been added to the user’s .bashrc file, e.g. for a previous version of OpenFOAM, then the line should be deleted or, alternatively, commented out by inserting a # at the start of the line.
‡ \relax \special {t4ht= If the user wishes to execute icoFoam in the same terminal window, he must first register the change to the .bashrc file by typing at the terminal prompt (note the dots):  . $HOME/.bashrc

Getting Started

Create a project directory within the $HOME/OpenFOAM directory named <USER>-1.7.1 (e.g. chris-1.7.1 for user chris and OpenFOAM version 1.7.1) and create a directory named run within it, e.g. by typing:

  • mkdir -p $FOAM_RUN

Copy the tutorial examples directory in the OpenFOAM distribution to the run directory. If the OpenFOAM environment variables are set correctly, then the following command will be correct:

  • cp -r $FOAM_TUTORIALS $FOAM_RUN

Run the first example case of incompressible laminar flow in a cavity:

  • cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
  • blockMesh
  • icoFoam
  • paraFoam

Refer to the OpenFOAM User Guide to get started.

Reporting Bugs in OpenFOAM

We appreciate that bugs in OpenFOAM are reported so we can fix them. Please refer to the OpenFOAM bugs pages to report bugs.