Installation OpenFOAM-7
Installation OpenFOAM-7
on
on
Ubuntu 18.04 or later
Ubuntu 18.04 or later
Install the necessary packages
Install the necessary packages
Open terminal (Ctrl+Alt+T) - copy and paste following lines:
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
Downloading Source Code
If using git protocol:
If using git protocol:
git clone git://github.com/OpenFOAM/OpenFOAM-7.git
git clone git://github.com/OpenFOAM/ThirdParty-7.git
else using https protocol:
else using https protocol:
git clone https://github.com/OpenFOAM/OpenFOAM-7.git
git clone https://github.com/OpenFOAM/ThirdParty-7.git
Setting the Environment
Setting the Environment
1. Open bashrc file with Gedit:
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.
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:
3. Update system by using following command:
source ~/.bashrc
4. Check your directories:
4. Check your directories:
echo $WM_PROJECT_DIR
echo $WM_THIRD_PARTY_DIR
echo $ParaView_VERSION
if they are not correct check again your bashrc files, bashrc location
if they are not correct check again your bashrc files, bashrc location
Install Third Party Softwares
Install Third Party Softwares
1. Installing Scotch/PT-Scotch for domain decomposition for parallel running (essential)
1. Installing Scotch/PT-Scotch for domain decomposition for parallel running (essential)
cd $WM_THIRD_PARTY_DIR
./Allwmake
2. Installing ParaView (essential)
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-processing3. Install CGAL Computational Geometry Algorithms Library used by the experimental mesher, foamyHexMesh (not essential)
3. Install CGAL Computational Geometry Algorithms Library used by the experimental mesher, foamyHexMesh (not essential)
./makeCGAL
4. Update bashrs and enviroment
4. Update bashrs and enviroment
source ~/.bashrc
wmRefresh
Compiling OpenFOAM
Compiling OpenFOAM
cd $WM_PROJECT_DIR
./Allwmake
Or you can compile faster with all available cores/hyperthreads :
./Allwmake -j
Getting Started
Getting Started
Check installed OpenFoam by copy and run one toturials:
Check installed OpenFoam by copy and run one toturials:
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
cd pitzDaily
blockMesh
simpleFoam
paraFoam
If you are new to OpenFOAM, then you can find more turorial in
$FOAM_TUTORIALS
echo $FOAM_TUTORIALS
References:
References: