I wrote this when using Ubuntu Breeze Badger. Now I am using Hardy (32Bit)... note that version 1.5 has been recently released.
update 13-Septempber-2008: OpenFOAM release 1.5 is slightly different but easier to install in a stand alone configuration, I will describe the steps here but the old guide (v1.4.1 and older) will still be found in this document just for reference. One of the main changes is the discontinuation of FoamX, from now on the configuration files are to be modified by using your favorite text editor. The other main change is the use of paraview 3.0
The instruccions for installation are:
(1)Create the OpenFOAM folder in you home
(2)navigate to the OpenFOAM webpage and download from there the five installation files: OpenFOAM-1.5.General.gtgz, OpenFOAM-1.5.linuxGccDPOpt.gtgz, OpenFOAM-1.5.linuxGccSPOpt.gtgz, ThirdParty.General.gtgz, ThirdParty.linuxGcc.gtgz
(3)Extract the files in this location in starting with those marked as *general*
(4)You will see that two new folders are created: OpenFOAM-1.5 and ThirParty
(5)Update your environment variables by adding the following line to our .bashrc script
now 'source' the variables with
(5)Navigate to OpenFOAM-1.5/bin and execute the foamIntallationTest script
Since this is a standalone installation you will see that the script fails to connect to a remote server, however as I said before 'who cares' just ignore this message.
This is all you need to do, OpenFOAM is ready to run. Please see the documentation since some syntax has been changed.
I found one problem: After finishing a case a file called file.OpenFOAM containing your computation is created which is supposed to open fine when paraview is called, however an error when reading these type of files arises when one is trying to load them. The quick fix is to export the file to VTK by using the 'foamToVTK' utility and then opening the exported file normally with paraview.
update 25-february-2008: WIndows users willing to install OpenFoam under XP/Vista read this guide and the advice by "Florante" from the andLinux forum here:
this will solve the the paraView visualisation problem...
date:23-february-2008: Note to **Windows** users: You may try to install OpenFOAM on Windows XP/VISTA via andLinux (http://www.andlinux.org) (colinux+Ubuntu) and following the guide below. I've made an attempt and the solvers are working just fine. However paraView for any reason is not working properly. The GUI works OK but the visualisation window is not displaying anything at all (at least on my computer). I will try to check this in the future and/or install any alternative such as OpenDX and post the results here...
Thanks everybody for your comments... enjoy
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This Thread/Howto is aimed to all Engineers, Scientist, Students interested in learning/applying/experimenting Computational Fluids Dynamics (CFD), CFD uses numerical approximation to the partial differential equations that govern flow of fluids in nature (i.e. Navier-Stokes equation, etc) the solution of the Navier-Stokes equation once it comply with the requirements of the Continuity equation gives the behavior of the fluids subject to the given boundary and initial conditions. This has a tremendous importance since practically any fluid can be simulated/modeled in a computer before doing any 'real life' experiment. For example you can test the design of a new aircraft using computational techniques before even build a small scale protitype for wind tunnel testing. Thus a wide range of experimental conditions can be fully tested and corrected on the fly...
Since the basic equations (full) that govern fluid flow are in form of PDEs, the numerical methods to approximate the solution are complex, a very simple problem can be solved in a couple of minutes however if the problem is much more complicated the solver can take days in find a solution... in general CFD is not intended for common PCs but for high end computers designed to tackle this kind of problems. Of course this cannot stop you, you can install this software in your computer and 'play' with simple geometries and doing a lot of assumptions to solve a given problem more easily.
There are several CFD brands out there like Fluent, COMSOL, CFD-RC, CFD-ADAPCO, (which are quite expensive though) ... however there are also free alternatives like ELMER Multiphysics (I have already dowloaded but not playing around with it!), OpenFOAM and many others.
Inherently CFD software is a bit complicated to use, it requires a deep understanding of the physical phenomena involved in given problem, and a good mathematical background (this is a plus)
Well, after that boring introduction, this is the ultimate guide to install OpenFOAM in an Ubuntu System, I decided to this because (1) I do really need a CFD software to experiment with. (2) Commercial software is expensive (you know as a student you've got a very limited budget, I would have to spend all my year savings only for a one year license!!!!) (3) Help the scientific/student community with freely available tools. (4) Understand more about the world/nature around us...
* * * Step One * * * *
First of all System requirements (well based on my PC!!!!)
-An x86 processor or equivalent. I am using a Core 2 Duo T5600 and running great!)
-640 MB (The web page states nothing, but everybody knows the more, the better)
-1 GB hard drive available, this is a must, uncompressed files takes 750 MB, plus the cases, tutorials, grids, etc
-broadband conection (the compressed files are from 50 to 100 MB average) of course you can use dial up and wait 48 hours to download it, it's up to you...
-Ubuntu LINUX 6.10 Edgy Eft (it works also in Dapper and Breeze) , if you download the AMD64 version then use the 64bit LINUX kernel
2 * * * * * * * * * * * * *
Enter to OpenFOAM web page
3 * Click on download
4 * Select your version
5 * Dowload all the packges to your Desktop (very advance LINUX users can avoid obvious steps)
where ~/ is the home folder for example /home/<username>
N.B from this point it is necesary to remenber that LINUX is CASE SENSITIVE, a mistake can delay you some hours...
second I did install everything in my home folder which is ~/ it is the recommended option from the web site
6 * create a folder caller OpenFOAM in ~/ using mkdir
which are on ~/Desktop to the folder you've just created ~/OpenFOAM
7 * create the following folder (remember LINUX is case sensitive)
8 * copy
which are in ~/Desktop to ~/OpenFOAM/linux
9 * untar avery single file in the following order
This takes a bit of time
tar -xzvf <filename>
10 * after finishing you will see new directories created in ~/OpenFOAM
11 * now look for foamSystemCheck
which is located at
this is a shell script that we have to execute, however we need to change it to an executable format
press enter, then type
chmod -v 555 foamSystemCheck
press enter, then type
At this time, the shell script will call some functions to check if your system comply with the minimum requirements for the installation, Host, username, Linux version, and Network conectivity, however at the end of the process some error occur, just ignore any warning or fatal error about ssh or rsh, this is not needed for the stand alone installation (It doesn't matter what it tells you, just ignore it!!!)
chmod -v 755 foamSystemCheck
12 * * * * * *
Now you have to set the environment variables for a correct file access
The environment variable settings are stored in
since I am using the default options in UBUNTU, my shell is BASH and my text editor is gedit, you can use VIM as well
(if you are not sure which shell you are using)
once in gedit type
N.B. it is dot, space~/.......
now update the environment typing
and then file>quit
N.B. it is dot space ~/.......
the environment variables are updated, you can see this if you type
We are almost done!!,
13 **** Now test the installation
look for foamInstallationTest
it is located at
in the same way this file is a shell script
chmod -v 555 foamInstallationTest
in this case you don't need to export the path, since you have already done it...
here the shell scrip verifies every directory and assigns to each of them an environment variable (PATH), also this takes a bit of time. However you will see an error at the end of the process, something like this:
FATAL: No remote shell available (blah, blah, blah, blah, etc....)
It is very simple: who cares, just ignore it.....
well for this new version of openFoam is likely that FoamX does not run in your system if you don't have the libssl.so.o.9.7 installed. A simple look at synaptic solve this problem... (thanks for orodoni_le for this). O course you can use OpenFoam without FoamX if you feel comfortable editing text files...
And it's done!!!!!!!
you will find there some PDFs with tutorials and very useful examples....
This section applies only to WIndows users
Alternative method for installing OpenFOAM in a windows system (2000/XP/VISTA) using andLinux(colinux+Ubuntu).
This method requires to install andLinux which is basically colinux(a linux kernel implementation for windows) xming(an X-server for windows) and Ubuntu. Once andLinux is installed it uses the Windows desktop instead of GNOME/KDE/etc...
Files you need to get:
The andLinux installer. For simplicity I decided to install the minimal version
The xming mesa-OpenGL version. For any reason the xming-version provided with andLinux interferes with paraView so you need to replace the shipped version with this one 6.9.031
The OpenFOAM installation files from the places indicated in the guide above.
-The first step is to install andLinux (which is straight forward). After the installation you will notice that the default installation size of andLinux is 2GB so we need to increase the size of the virtual drive for the OpenFOAM installation and also for any other applications you may need. To do this go to the installation directory of andLinux
stop andLinux by double clicking at srvstop.bat
Then look for
unzip that file in the current directory. Enter to the directory and look for the file
Execute this file. From the window that appears select *find file. Then navigate to
Select base.drv and change the size to at least 3GB with the slider. Click OK
Now navigate to the xming directory at:
look for xming.exe and rename it as xming_1.exe (just in case, this is our old version)
Now install the mesa version of xming. Once the installation finishes go to installation directory
and copy xming.exe from this location to
Reboot the computer
Now install OpenFOAM as described in the guide...
__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Well that's all, have fun
* * * * * derjames * * * * *