Friday, 29 January 2010

Installation of OpenFOAM 1.6 on Ubuntu 9.10

OpenFOAM is another open source CFD software. In order to install OpenFOAM onto Ubuntu 9.10, the following packages are necessary.

cmake g++ flex++ bison python qt4-designer binutils-dev zlib1g-dev

Use apt-get to install them before trying to install and use OpenFOAM.

:/$ sudo apt-get install cmake g++ flex++ bison python qt4-designer binutils-dev zlib1g-dev

A very brief introduction on the compilation

1. Download the related packages, including the source pack and the binary pack. Double precision is recommended.

2. Create a directory OpenFOAM under $HOME (or at other locations if you prefer), move the downloaded packages into it, and then execute

# ship into $HOME/OpenFOAM/
:/$ tar xzvf OpenFOAM-1.6.General.gtgz
:/$ tar xzvf ThirdParty-1.6.General.gtgz
:/$ tar xzvf OpenFOAM-1.6.linuxGccDPOpt.gtgz
:/$ tar xzvf ThirdParty-1.6.linuxGcc.gtgz

3. After the files extracted, source the file OpenFOAM-1.6/etc/bashrc.

# at $HOME/OpenFOAM/
:/$ source OpenFOAM-1.6/etc/bashrc

For convenience, a sentence could be incorporated into the user config file ~/.bashrc to avoid executing the command above manually in the future.

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

4. Compile ParaView. Ship into OpenFOAM/ThirdParty-1.6 and execute

sh makeParaView

5. Link OpenFOAM ParaView reader and ParaView.

:/$ cd $FOAM_UTILITIES/postProcessing/graphics/PV3FoamReader
:/$ ./Allwclean
:/$ ./Allwmake

The Windows version

"openfoam-mswin" is a project to provide an OpenFOAM binary release for MS windows. The project is hosted on SourceForge, and a self-install file for Windows can then be downloaded from its SourceForge site. With its help, it is easier to install and use OpenFOAM if Linux experience is absent.

Monday, 4 January 2010

Compile Code_Saturne with SALOME binary libraries

As instructed in "Installation of Code_Saturne 2.0.0 on Ubuntu 9.04", Code_Saturne needs libraries openmpi and metis to support parallel computing, and needs libraries hdf and med to support the MED file format. In the previous post, openmpi was installed by apt-get, however for the other three, metis, hdf and med, the libraries were built from the source code.

If, incidentally, you are also a SALOME user, it is possible to build Code_Saturne with the libraries shipped in the SALOME package. The advantage of doing this is saving time to download the latest source packages and compile them manually. Therefore, briefly, this post introduces the new compilation procedure of CS 2.0.0 with SALOME libraries.

1. install necessary packages using apt-get

:/$ sudo apt-get install build-essential gfortran libxml2 libxml2-dev libatlas-headers libatlas-base-dev openmpi-bin openmpi-dev libibverbs-dev openssh-server python-qt4 pyqt4-dev-tools

2. install SALOME. I assume you install SALOME 5.1.3, the latest version currently

Posts on SALOME installation can be referred and help on this step.

3. compile the four parts, bft, fvm, ecs and ncs. I assume you installed SALOME into "/home/salad/salome_5.1.3/", in which "salad" is my user name, and you have to use yours instead.

# ship into bft-1.1.1
:/$ ./configure
:/$ make
:/$ sudo make install
# ship into fvm-0.14.0
:/$ ./configure --with-hdf5=/home/salad/salome_5.1.3/hdf5-1.6.9 --with-med=/home/salad/salome_5.1.3/med-2.3.6 --with-mpi=/usr/lib/openmpi
:/$ make
:/$ sudo make install
# ship into ecs-2.0.0-beta2
:/$ ./configure --with-hdf5=/home/salad/salome_5.1.3/hdf5-1.6.9 --with-med=/home/salad/salome_5.1.3/med-2.3.6 --with-metis-include=/home/salad/salome_5.1.3/metis-4.0/Lib --with-metis-lib=/home/salad/salome_5.1.3/metis-4.0
:/$ make
:/$ sudo make install
# ship into ncs-2.0.0-beta2
:/$ ./configure --with-mpi=/usr/lib/openmpi --with-prepro=/usr/local LIBS=-lm
:/$ make
:/$ sudo make install