1. Install git (optional, but highly recommended)
sudo apt-get install git-core
2. Download the relevant CFDEMproject software:
cd $HOME
mkdir CFDEM
cd CFDEM
git clone git://github.com/CFDEMproject/CFDEMcoupling-PUBLIC.git
cd $HOME
mkdir LIGGGHTS
cd LIGGGHTS
git clone git://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git
git clone git://github.com/CFDEMproject/LPP.git lp
If git is not installed, you need to download it from the CFDEM github homepage and decompress it to the corresponding path. Usually the downloaded zip package has the suffix of master after decompression. In order to unify the path, you can modify the folder name as follows :
cd $HOME/CFDEM
mv CFDEMcoupling-PUBLIC-master CFDEMcoupling-PUBLIC
cd $HOME/LIGGGHTS
mv LIGGGHTS-PUBLIC-master LIGGGHTS-PUBLIC
mv LPP-master lpp
3. Download OpenFOAM
This step is a little more troublesome. You need to check the latest version number on Github. Click here and you will see a version information description file, as shown in the picture:
word OFversion="5.x-commit-538044ac05c4672b37c7df607dca1116fa88df88";
Then the current version number <OF-Release> is 5.x
<commitHashtag> is: 538044ac05c4672b37c7df607dca1116fa88df88
What is entered in the next statement is:
cd $HOME
mkdir OpenFOAM
cd OpenFOAM
git clone git://github.com/OpenFOAM/OpenFOAM-5.x.git
git clone git://github.com/OpenFOAM/ThirdParty-5.x.git
cd OpenFOAM-5.x
git checkout 538044ac05c4672b37c7df607dca1116fa88df88
4. Install the necessary libraries
sudo apt-get install build-essential flex bison cmake zlib1g-dev libboost-system-dev \
libboost-thread-dev libopenmpi-dev openmpi-bin gnuplot libreadline-dev libncurses-dev libxt-dev libscotch-dev libptscotch-dev
Install VTK, or you can manually compile VTK
sudo apt-get install libvtk6-dev
Install the necessary Python libraries:
sudo apt-get install python-numpy
5. Install OpenFOAM, refer to the installation tutorial on the official website
(1) Set the OpenFOAM environment variables:
sudo gedit ~/.bashrc
Add the following two lines of code at the end of the file, but since we downloaded the OpenFOAM-5.x version, the "source $HOME/OpenFOAM/OpenFOAM-dev/etc/bashrc" on the official website is changed to:
(1)source $HOME/OpenFOAM/OpenFOAM-5.x/etc/bashrc
[Suggestion] Add the following sentence "export WM_NCOMPPROCS=<Nof-Process>", where <Nof-Process> is the number of processors used for compilation. I added the following sentence at the end of the .bashrc file:
(2)export WM_NCOMPPROCS=4
Save the .bashrc file and source it.
source ~/.bashrc
(2) Check the environment variable configuration: Re-open a terminal and enter
echo $WM_PROJECT_DIR
If the output is as follows, the configuration is successful. (chris is the username)
/home/chris/OpenFOAM/OpenFOAM-5.x
(3) Compiling OpenFOAM: It takes about half an hour.
cd $WM_PROJECT_DIR
./Allwmake
(4) Compile Paraview:
cd $WM_THIRD_PARTY_DIR
./makeParaview
After successful compilation and installation, as shown below. If you encounter compilation problems, you can refer to my other two blog posts:
Solutions to CMake Error at CMake/ParaViewQt.cmake:65 (find_package) when compiling and installing Paraview.