OpenFOAM

From LWP-Wiki
Revision as of 16:03, 30 March 2022 by Lwpadmin (talk | contribs)
Jump to navigation Jump to search

Both openFOAM repositories (org & com) are available on the LWP. Instructions on how to install packages on the LWP can be found here. Students do not have permission to install software, because the PCs in the computer rooms need to diverge as little as possible, but you can send us a request to install it on your system, by using the "support request" icon on the desktop or selecting it from the menu.

Since there are quite a few versions of openFOAM(com/org) and it's extensions floating around, installing a version on a system can cause conflicts for other users on that system. Thankfully the foam developers recognize this and have made it possible to install a version or extensions into your own home directory without requiring elevated privileges. This way multiple users on the same system can use their own versions and extensions. Compilation of some of these will take some time.


The FOAM extensions described here have been verified to work for unprivileged users.


Install (or request we install) the following packages on your system:

$ sudo apt install openfoam2112 openfoam2112-dev gfortran-10

Now set up the requirements for openFOAM:

cd ~
mkdir foam
cd foam
curl https://www.paraview.org/paraview-downloads/download.php\?submit=Download\&version=v5.10\&type=binary\&os=Linux\&downloadFile=ParaView-5.10.1-MPI-Linux-Python3.9-x86_64.tar.gz -o ParaView-5.10.1-MPI-Linux-Python3.9-x86_64.tar.gz
tar xzf ParaView-5.10.1-MPI-Linux-Python3.9-x86_64.tar.gz
echo "export PATH=~/foam/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin:$PATH" >> ~/.bashrc
echo "source /usr/lib/openfoam/openfoam2112/etc/bashrc" >> ~/.bashrc
source ~/.bashrc
openfoam2112
exit

Installing foam-extend-4.1:

git clone git://git.code.sf.net/p/foam-extend/foam-extend-4.1
cd ~/foam/foam-extend-4.1
source etc/bashrc
echo "alias fe41='. ~/foam/foam-extend-4.1/etc/bashrc'" >> ~/.bashrc
source ~/.bashrc
./Allwmake.firstInstall -j8 # the -j<number> refers to the number of CPU cores to use for compiling the software (more = faster)

Installing OlaFlow:

git clone git://github.com/phicau/olaFlow.git
cd olaFlow
./allMake -j8

Installing solids4foam:

mkdir -p $FOAM_RUN
cd $FOAM_RUN/..
git clone https://bitbucket.org/philip_cardiff/solids4foam-release.git
./Allwmake -j8