Installation OpenFOAM-7

on

Ubuntu 18.04 or later

Install the necessary packages

Open terminal (Ctrl+Alt+T) - copy and paste following lines:

sudo apt-get install build-essential flex bison git-core cmake zlib1g-dev libboost-system-dev libboost-thread-dev libopenmpi-dev openmpi-bin gnuplot libreadline-dev libncurses-dev libxt-dev
sudo apt-get install libqt5x11extras5-dev libxt-dev qt5-default qttools5-dev curl libcgal-dev libglu1-mesa-dev

Downloading Source Code

If using git protocol:


git clone git://github.com/OpenFOAM/OpenFOAM-7.gitgit clone git://github.com/OpenFOAM/ThirdParty-7.git

else using https protocol:


git clone https://github.com/OpenFOAM/OpenFOAM-7.gitgit clone https://github.com/OpenFOAM/ThirdParty-7.git

Setting the Environment

1. Open bashrc file with Gedit:


sudo gedit ~/.bashrc

2. Copy location of file bashrc of openFOAM to the end of file bashrc of system. Save and close.


(where folder located)/OpenFOAM-7/etc/bashrc FOAMY_HEX_MESH=yes

3. Update system by using following command:


source ~/.bashrc

4. Check your directories:


echo $WM_PROJECT_DIRecho $WM_THIRD_PARTY_DIRecho $ParaView_VERSION

if they are not correct check again your bashrc files, bashrc location

Install Third Party Softwares

1. Installing Scotch/PT-Scotch for domain decomposition for parallel running (essential)


cd $WM_THIRD_PARTY_DIR./Allwmake

2. Installing ParaView (essential)


./makeParaView
if you cannot properly install it. Dont worry! Just install paraview
sudo apt-get install paraview
then using paraFoam -buitlin for post-processing

3. Install CGAL Computational Geometry Algorithms Library used by the experimental mesher, foamyHexMesh (not essential)


./makeCGAL

4. Update bashrs and enviroment


source ~/.bashrcwmRefresh

Compiling OpenFOAM

cd $WM_PROJECT_DIR
./Allwmake
Or you can compile faster with all available cores/hyperthreads :
./Allwmake -j

Getting Started

Check installed OpenFoam by copy and run one toturials:


cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .cd pitzDailyblockMeshsimpleFoamparaFoam
If you are new to OpenFOAM, then you can find more turorial in $FOAM_TUTORIALS
echo $FOAM_TUTORIALS

Home

Source & Installation

Mesh & Geometry

Cases & Projects

Programming & Codes

Coupling