3 #+TITLE: *OpenFOAM README for version 1.5*
6 #+LINK: http://www.opencfd.co.uk
10 OpenFOAM is free software; you can redistribute it and/or modify it under the
11 terms of the GNU General Public License as published by the Free Software
12 Foundation; either version 2 of the License, or (at your option) any later
13 version. See the file COPYING in this directory, for a description of the GNU
14 General Public License terms under which you can copy the files.
17 OpenFOAM is developed and tested on Linux, but should work with other Unix
18 style systems. To check your system setup, execute the foamSystemCheck script
19 in the bin/ directory of the OpenFOAM installation. If no problems are
20 reported, proceed to "3. Installation"; otherwise contact your system
23 If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the
24 section "Running OpenFOAM in 32-bit mode".
26 *** Qt (from http://trolltech.com/products/qt)
27 The ParaView 3.3 visualisation package requires that Qt version 4.3.x MUST
28 be installed on the system. Earlier or more recent versions (4.2.x or
29 4.4.x) will NOT work. To check whether Qt4 is installed, and the version,
33 The ParaView binary executables in the ThirdParty distribution will only
34 work with PRECISELY the same version of Qt with which it was compiled. The
35 64-bit version of ParaView was compiled with Qt-4.3.1 (with openSuSE-10.3)
36 and the 32-bit version of ParaView was compiled with Qt-4.3.2 (with
37 ubuntu-7.10). If the user finds that a ParaView binary fails to run, then
38 it is almost certainly due to a conflict in compiled and installed Qt
39 versions and they will need to consult the section below on "Compiling
40 ParaView and the PV3FoamReader module."
42 The default versions of Qt used by some GNU/Linux releases are as follows.
43 + ubuntu-7.10: Version 4.3.2
44 + ubuntu-8.04: Version 4.3.4
45 + openSuSE-10.2: Version 4.2.1 - too old
46 + openSuSE-10.3: Version 4.3.1
47 + openSuSE-11.0: Version 4.4.0 - too new
49 Compilation and running of ParaView has been successful using the libraries
50 downloaded in the "libqt4-dev" package on ubuntu.
52 If you don't have an appropriate version of Qt installed you can download
53 the sources from TrollTech e.g.:
54 ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2
55 and compile and install in /usr/local or some other location that does to
56 conflict with the pre-installed version.
59 Download and unpack the files in the $HOME/OpenFOAM directory as described in:
60 http://www.OpenFOAM.org/download.html
62 The environment variable settings are contained in files in an etc/ directory
63 in the OpenFOAM release. e.g. in
65 + $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/
66 + where <VERSION> corresponds to the version 1.4, 1.5, ...
68 1) EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the
69 etc/bashrc file by adding the following line to the end of your
72 + . $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/bashrc
74 Then update the environment variables by sourcing the $HOME/.bashrc file by
75 typing in the terminal:
79 2) OR, if running tcsh or csh, source the etc/cshrc file by adding the
80 following line to the end of your $HOME/.cshrc file:
82 + source $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/cshrc
84 Then update the environment variables by sourcing the $HOME/.cshrc file by
85 typing in the terminal:
89 *** Installation in alternative locations
90 OpenFOAM may also be installed in alternative locations. However, the
91 installation directory should be network available (e.g., NFS) if parallel
92 calculations are planned.
94 The environment variable 'FOAM_INST_DIR' can be used to find and source the
95 appropriate resource file. Here is a bash/ksh/sh example:
97 + export FOAM_INST_DIR=/data/app/OpenFOAM
98 + foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
99 + [ -f $foamDotFile ] && . $foamDotFile
101 and a csh/tcsh example:
103 + setenv FOAM_INST_DIR /data/app/OpenFOAM
104 + foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
105 + if ( -f $foamDotFile ) source $foamDotFile
107 The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts
108 of the OpenFOAM installation.
110 * Building from Sources (Optional)
111 If you cannot find an appropriate binary pack for your platform, you can build
112 the complete OpenFOAM from the source-pack. You will first need to compile or
113 obtain a recent version of gcc (we recomend gcc-4.3.?) for your platform,
114 which may be obtained from http://gcc.gnu.org/.
116 Install the compiler in
117 $WM_PROJECT_INST_DIR/ThirdParty/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/
118 and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and
119 $WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the
120 environment variables as in section 3.
122 Now go to the top-level source directory $WM_PROJECT_DIR and execute the
123 top-level build script './Allwmake'. In principle this will build everything,
124 but if problems occur with the build order it may be necessary to update the
125 environment variables and re-execute 'Allwmake'. If you experience
126 difficulties with building the source-pack, or your platform is not currently
127 supported, please contact <enquiries@OpenCFD.co.uk> to negotiate a support
128 contract and we will do the port and maintain it for future releases.
130 * Testing the installation
131 To check your installation setup, execute the 'foamInstallationTest' script
132 (in the bin/ directory of the OpenFOAM installation). If no problems are
133 reported, proceed to getting started with OpenFOAM; otherwise, go back and
134 check you have installed the software correctly and/or contact your system
138 Create a project directory within the $HOME/OpenFOAM directory named
139 <USER>-<VERSION> (e.g. 'chris-1.5' for user chris and OpenFOAM version 1.5)
140 and create a directory named 'run' within it, e.g. by typing:
142 + mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
144 Copy the 'tutorial' examples directory in the OpenFOAM distribution to the
145 'run' directory. If the OpenFOAM environment variables are set correctly,
146 then the following command will be correct:
148 + cp -r $WM_PROJECT_DIR/tutorials
149 $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
151 Run the first example case of incompressible laminar flow in a cavity:
153 + cd $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run/tutorials/icoFoam/cavity
158 * Compiling Paraview 3.3 and the PV3FoamReader module
159 A version of Qt 4.3.x must be installed to compile ParaView. The compilation
160 is a fairly simple process using the supplied buildParaView3.3-cvs script that
161 has worked is our tests with other packages supplied in the ThirdParty
162 directory, namely cmake-2.4.6 and gcc-4.3.1. Execute the following:
163 + cd $FOAM_INST_DIR/ThirdParty
164 + rm -rf ParaView3.3-cvs/platforms
165 + buildParaView3.3-cvs
167 The PV3FoamReader module is an OpenFOAM utility that can be compiled in the
168 usual manner as follows:
169 + cd $FOAM_UTILITIES/postProcessing/graphics/PV3FoamReader
174 http://www.OpenFOAM.org/doc
177 http://www.OpenFOAM.org http://www.OpenFOAM.org/discussion.html
179 * Reporting Bugs in OpenFOAM
180 http://www.OpenFOAM.org/bugs.html
182 * Running OpenFOAM in 32-bit mode on 64-bit machines
183 Linux users with a 64-bit machine may install either the OpenFOAM 32-bit
184 version (linux) or the OpenFOAM 64-bit version (linux64), or both. The 64-bit
185 is the default mode on a 64-bit machine. To use an installed 32-bit version,
186 the user must set the environment variable WM_ARCH_OPTION to 32 before
187 sourcing the etc/bashrc (or etc/cshrc) file.