Open FOAM
Open FOAM
The teaching is designed so that you should follow the steps I do on a computer.
It is highly recommended that you install the software on your own laptop so th
at you are independent. The Linux commands below are written for bash shell.
By following the instructions below, you should be able to install Ubuntu 14.04
LTS, OpenFOAM-2.3.x (one optimal and one debug version), foam-extend-3.1, PyFoam
, Python packages, Gnuplot etc., and later perhaps some additional useful things
that we will use in the course. We will pull the git source and compile from sc
ratch, since we will then get access to updates and bug fixes. OpenFOAM-2.3.0 ca
n also be installed as a package, which is much faster, but gives less control i
n my opinion (http://openfoam.com/download/ubuntu.php). Feel free to try it out
if you like you can have both that version and the git versions installed at the
same time!
Note that I am (unfortunately) using Word to generate this web page, which means
that Word sometimes decides to change some characters to other characters that
look the same, but arent (e.g. is not the same as - or -- and is not the same as
"). I think that I have fixed this everywhere, but you never know. That is one r
eason for copy-pasting single rows rather than multiple rows, and check that all
went well. Another reason is that some lines will require you to press a key at
some point, such as the sudo apt-get lines. Let me know if you run into problems,
and Ill help you.
Installation and updating of Ubuntu 14.04 LTS in Virtual Box (under Windows 7, i
n this case):
For OpenFOAM-2.3.x, the PyFoam package is not included (which it is for foam-ext
end).
We will follow the installation instructions for PyFoam at http://openfoamwiki.n
et/index.php/Contrib_PyFoam
Condensed installation instructions:
mkdir $HOME/OpenFOAM/linuxSrc
cd $HOME/OpenFOAM/linuxSrc
wget http://openfoamwiki.net/images/8/89/PyFoam-0.6.2.tar.gz
tar xzf PyFoam-0.6.2.tar.gz
rm PyFoam-0.6.2.tar.gz
cd PyFoam-0.6.2
Install as regular user (recommended):
You will see numerous pyFoam commands that can be used to help you use OpenFOAM
efficiently.
Install foam-extend-3.1 (including PyFoam, swak4Foam etc.)
The foam-extend (foam-extend.org) fork has some features that are not in OpenFOA
M-x.x.x, such as the GGI interface. If you do not need those features, you do no
t have to follow this section.
This section takes about 5h or more leave the computer over-night (where this me
ssage is repeated).
http://sourceforge.net/p/openfoam-extend/wiki/Home/
http://openfoamwiki.net/index.php/Installation/Linux/foam-extend-3.1
Open new terminal window and type (line-by-line, since you have to type your pas
sword on the sudo lines)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core build-essential binutils-dev flex zlib1g-dev qt4-d
ev-tools libqt4-dev
mkdir $HOME/foam
cd $HOME/foam
git clone git://git.code.sf.net/p/openfoam-extend/foam-extend-3.1 foam-extend-3.
1
cd foam-extend-3.1
This part is where I do some changes to the installation procedure, to use more
system installed software in Ubuntu 14.04. You can skip this if you like. But th
en you will not have Paraview compiled, and you will waste some disk space on so
ftware that may be installed in the system. Instead of compiling Paraview, you c
an also install it with sudo apt-get paraview, but then you dont get the foam-exten
d-specific reader.
####################################################################
#
# Create a prefs.sh file
cp etc/prefs.sh-EXAMPLE etc/prefs.sh
# Make the sourcing less chatty
sed -i s/"FOAM_VERBOSE=1"/"FOAM_VERBOSE="/g etc/prefs.sh
# Use openmpi 1.6.5 as supplied by Ubuntu 14.04
sed -i s/"#export WM_MPLIB=SYSTEMOPENMPI"/"export WM_MPLIB=SYSTEMOPENMPI"/g etc
/prefs.sh
sed -i s/"#export OPENMPI_DIR=path_to_system_installed_openmpi"/"export OPENMPI
_DIR=\/usr"/g etc/prefs.sh
sed -i s/"#export OPENMPI_BIN_DIR=\$OPENMPI_DIR\/bin"/"export OPENMPI_BIN_DIR=\
$OPENMPI_DIR\/bin"/g etc/prefs.sh
# Use Qt 4.8.6 as provided by Ubuntu 14.04 (instead of 4.8.5, in ThirdParty)
sed -i s/"#export QT_DIR=path_to_system_installed_qt"/"export QT_DIR=\/usr"/g e
tc/prefs.sh
sed -i s/"#export QT_BIN_DIR=\$QT_DIR\/bin"/"export QT_BIN_DIR=\$QT_DIR\/bin"/g
etc/prefs.sh
# Use cmake 2.8.12.2 as provided by Ubuntu 14.04 (instead of 2.8.12, in ThirdP
arty)
sed -i s/"( rpm_make -p cmake"/"#( rpm_make -p cmake"/g ThirdParty/AllMake.stage
1
# Compile and install bison-2.7 from the ThirdParty packages.
sed -i 0,/"#( rpm_make -p bison-2.7"/s//"( rpm_make -p bison-2.7"/ ThirdParty/Al
lMake.stage1
#
####################################################################
See the etc/prefs-sh-EXAMPLE file for more examples, e.g.:
#Tell the compiler to use the number of cores you have available (if you uncom
ment the line and change the number 4 to what you have)
#echo "export WM_NCOMPPROCS=4" >> etc/prefs.sh
#Use the system installation of paraview (if you uncomment the following lines
)
#sed -i s/"#export PARAVIEW_SYSTEM=1"/"export PARAVIEW_SYSTEM=1"/g etc/prefs.s
h
#sed -i s/"#export PARAVIEW_DIR=path_to_system_installed_paraview"/"export PAR
AVIEW_DIR=\/usr "/g etc/prefs.sh
#sed -i s/"#export PARAVIEW_BIN_DIR=\$PARAVIEW_DIR\/bin"/"export PARAVIEW_BIN_
DIR=\$PARAVIEW_DIR\/bin"/g etc/prefs.sh
#sed -i -e s=\.OpenFOAM=\.foam= $HOME/foam/foam-extend-3.1/bin/paraFoam
####################################################################
Set up the foam-extend-3.1 environment:
echo "alias fe31= . \$HOME/foam/foam-extend-3.1/etc/bashrc " >> $HOME/.bashrc
Close the terminal window and open a new one (doing: CTRL-ALT_T) and type:
f31
-------------------------------------------------Installation/swak4Foam/Installing On/Ubuntu
< Installation | swak4Foam | Installing On
1 Introduction
This page is dedicated to explaining how to install swak4Foam in Ubuntu.
If you do not yet feel comfortable using Linux, then perhaps you better first re
ad the page Working with the Shell and train a bit with the shell/terminal envir
onments, so you can have a better perception of the steps shown below.
Contents
1 Introduction
2 Copy-Paste steps
2.1 Ubuntu 10.04 to 14.10
2 Copy-Paste steps
A few notes before you start copy-pasting:
Lines that start with # don t have to be copy-pasted. They are just comments
to let you know what s going on.
One wrong character is enough for breaking this guide, so make sure you can
read the characters properly or that the installed language system does not brea
k the copied characters!
2.1 Ubuntu 10.04 to 14.10
Discussion thread where you can ask questions about these steps: None available
at the moment.
Steps:
Install the necessary packages:
sudo apt-get install build-essential bison flex subversion git mercurial wge
t
The following packages are optional, depending on where you download it from
:
subversion - If you re going to download from an SVN repository.
git - If you re going to download from a Git repository.
mercurial - If you re going to download from a Mercurial repository.
wget - If you re going to download a snapshot directly from the command
line.
You might only know which optional package you ll need, when following the i
nstructions from the following step.
Now, to download and unpack swak4Foam, please follow the respective instruct
ions from this page: Installation/swak4Foam/Downloading - once you ve completed
the download and unpacking process, then you can proceed to the following step.
Now let s build swak4Foam:
#Go into swak4Foam s main source folder
cd swak4Foam
# This next command will take a while...