Ubuntu/Debian pack installation
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.
- In a terminal window, first get superuser privileges using sudo by typing:
sudo su
- 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
- Update the apt package list to account for the new download repository
location apt-get update
- Install OpenFOAM (171 in the name refers to version 1.7.1): apt-get install openfoam171
- Install Paraview (380 in the name refers to version 3.8.0): apt-get install paraviewopenfoam380
- OpenFOAM is now installed. Exit the superuser account by typing:
exit
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
(note the dot) and save
the file . /opt/openfoam171/etc/bashrc
- This change to the .bashrc file will be . ~/.bashrc
- Open a new
terminal window 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.
Notes:
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.
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.