Ubuntu Deb Pack Installation
Ubuntu Versions
OpenFOAM and Paraview are currently available for the following versions of Ubuntu:
- 10.04 LTS, codename lucid
- 11.04, codename natty
- 11.10, codename oneiric
Installation
OpenFOAM and Paraview can be simply installed using the apt package management tool. The user will need to provide superuser password authentication when executing the following commands with sudo
- In a terminal window, add OpenFOAM to the list of repository
locations for apt to search, by copying and pasting the following in a
terminal prompt (Applications -> Accessories -> Terminal).
VERS=`lsb_release -cs`
sudo sh -c "echo deb http://www.openfoam.org/download/ubuntu $VERS main > /etc/apt/sources.list.d/openfoam.list"- Note 1: Line 1 stores the version name of your Ubuntu distribution (e.g. maverick) under $VERS, which is used in line 2
- Note 2: This only needs to be done once for a given system
- Update the apt package list to account for the new download repository
location sudo apt-get update
- 30 Jan 2012: Due to changes in download mirror redirects that
exceed a 360 character limit on URLs in APT, packages need to be
pre-downloaded. Copy and Paste the following lines into a terminal
prompt sudo wget -P /var/cache/apt/archives `apt-get -qq --print-uris install openfoam210 | awk -F\' '{print $2}'`
sudo wget -P /var/cache/apt/archives `apt-get -qq --print-uris install paraviewopenfoam3120 | awk -F\' '{print $2}'` - Install OpenFOAM (210 in the name refers to version 2.1.0): sudo apt-get install openfoam210
- Install Paraview (3120 in the name refers to version 3.12.0): sudo apt-get install paraviewopenfoam3120
OpenFOAM-2.1.0 and Paraview-3.12.0 are now installed in the /opt directory.
User Configuration
In order to use the installed OpenFOAM package, complete the following
- 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
- At the bottom of that file, add the following line (see Note 1) and save the
file source /opt/openfoam210/etc/bashrc
- Open a new terminal window (see Note 2) and test that the icoFoam
application, from the OpenFOAM package, is working by typing
icoFoam -help
- A “Usage” message should appear. Your installation and user configuration is complete.
Note 1: 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 beginning of the
line.
Note 2: If a user wishes to execute icoFoam in the same terminal window, they
must first register the change to the .bashrc file by typing at the terminal
prompt (note the dots): source $HOME/.bashrc
Getting Started
Create a project directory within the $HOME/OpenFOAM directory named <USER>-2.1.0 (e.g. chris-2.1.0 for user chris and OpenFOAM version 2.1.0) and create a directory named run within it, e.g. by typing:
blockMesh
icoFoam
paraFoam
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.