Installation
This section describes how to download repositories of the CFDEM®project from github.com . After setting some environment variables, LIGGGHTS® and CFDEM®coupling can be compiled.
Procedure:
Short summary:
Install git:
This step is optional, but recommended. Git allows you to update the source code very easily with the git pull command. On debian based systems you can run
sudo apt-get install git-core
Similar packages are available on other systems too:
sudo zypper install git-core sudo yum install git
Note
In this tutorial the git protocol is used to transfer files. If port 9418 is closed for internet connections, please switch to “https://” instead of “git://” for git clone commands.
Download CFDEMproject software:
With git you can clone git repositories from github . The following terminal commands will download the CFDEM®project software to your machine in the typical folder structure. The download of the post-processing tool LPP is optional and requires python-numpy.
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 lpp
If you do not have git, you can use the download buttons after visiting a repository in the CFDEMproject project page and unzip the archives to the proper locations. Typically github tags the folders with “-master”, please rename them with
cd $HOME/CFDEM mv CFDEMcoupling-PUBLIC-master CFDEMcoupling-PUBLIC cd $HOME/LIGGGHTS mv LIGGGHTS-PUBLIC-master LIGGGHTS-PUBLIC mv LPP-master lpp
Download the correct OpenFOAM® version:
All mentions of OpenFOAM® refer to this . It is strongly recommended to compile OpenFOAM® yourself with the latest compatible version. The latest compatible OpenFOAM®-version can be found in the in your local copy of CFDEM®coupling in src/lagrangian/cfdemParticle/cfdTools/versionInfo.H, or directly at github . Look for the git commit hashtag in the following line:
word OFversion="<OF-Release>-commit-<commitHashtag>"; e.g. word OFversion="5.x-commit-538044ac05c4672b37c7df607dca1116fa88df88";
With git you can use the following recipe to get the correct version:
cd $HOME mkdir OpenFOAM cd OpenFOAM git clone git://github.com/OpenFOAM/OpenFOAM-<OF-Release>.git git clone git://github.com/OpenFOAM/ThirdParty-<OF-Release>.git cd OpenFOAM-<OF-Release> git checkout <commitHashtag>
Without git you can visit git://github.com/OpenFOAM/OpenFOAM-<OF-Release>/tree/<commitHashtag> and use the download button.
Other OpenFOAM® versions can be used for compilation, but aren’t officially supported. The list includes 4.x, 3.x, 2.4.x, 1612+, 1606+ and extend-3.2
Setup prerequisites for CFDEM®project:
Prerequisites for OpenFOAM® can be found here . On an Ubuntu system (14.04+), you can use the following
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
CFDEM®project requires OpenFOAM® with a working MPI version. Optional, but strongly recommended is the use of VTK . VTK is used to directly write data in vtk format, which is readable by ParaView . The minimum version is VTK 5.8, recommended is 6.3. On debian-based systems it is sufficient to run
sudo apt-get install libvtk6-dev
For manual VTK compilation, please read the additional installation hints .
The post-processing tool lpp requires the python numpy package.
sudo apt-get install python-numpy
Setup and compile OpenFOAM®
You can follow the OpenFOAM® git compilation instructions , with a small number of exceptions: CFDEM®coupling requires the WM_LABEL_SIZE=32 , which is the standard setting.
On an Ubuntu system (14.04+), you can use the following steps to install OpenFOAM®:
gedit ~/.bashrc add the following two lines in the end, where <NofProcs> is the integer number of the processors you want to compile with. Save and exit gedit. "export WM_NCOMPPROCS=<NofProcs>" "source $HOME/OpenFOAM/OpenFOAM-<OF-Release>/etc/bashrc" now again in the terminal: source ~/.bashrc cd $WM_PROJECT_DIR foamSystemCheck ./Allwmake
Additional OpenFOAM® installation hints can be found here .
Set environment variables and paths
Typically the CFDEM®coupling folder is tagged with the OpenFOAM® version number. To do this, perform the following steps:
cd $HOME/CFDEM mv CFDEMcoupling-PUBLIC CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION
You need to set some environment variables in ~/.bashrc (if you use c-shell, manipulate ~/.cshrc accordingly). Open your .bashrc and the CFDEM®coupling bashrc file.
gedit ~/.bashrc $HOME/CFDEM/CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION/src/lagrangian/cfdemParticle/etc/bashrc
Add the STANDARD block to the end of your bashrc and modify entries if necessary. Make sure the statements are not comments; remove the “#”. Similar to:
#================================================# #- source cfdem env vars export CFDEM_VERSION=PUBLIC export CFDEM_PROJECT_DIR=$HOME/CFDEM/CFDEMcoupling-$CFDEM_VERSION-$WM_PROJECT_VERSION export CFDEM_PROJECT_USER_DIR=$HOME/CFDEM/$LOGNAME-$CFDEM_VERSION-$WM_PROJECT_VERSION export CFDEM_bashrc=$CFDEM_PROJECT_DIR/src/lagrangian/cfdemParticle/etc/bashrc export CFDEM_LIGGGHTS_SRC_DIR=$HOME/LIGGGHTS/LIGGGHTS-PUBLIC/src export CFDEM_LIGGGHTS_MAKEFILE_NAME=auto export CFDEM_LPP_DIR=$HOME/LIGGGHTS/lpp/src . $CFDEM_bashrc #================================================#
You may insert the EXTENDED block above ”. $CFDEM_bashrc” for further customization. The detailed description for allowed entries can be found here .
To load and check the environment you can run now
source ~/.bashrc cfdemSysTest
Note
Many useful aliases are set with sourcing of the CFDEMcoupling bashrc, e.g. cfdemEtc . Make use of them!
Compile LIGGGHTS® and CFDEM®coupling
To compile CFDEM®project open a new terminal and run
cfdemCompCFDEMall
It compiles the LIGGGHTS® executable, LIGGGHTS® as a shared library, the CFDEM®coupling libraries, CFDEM®coupling solvers and CFDEM®coupling utilities. The compilation will stop, if build errors occur. Having a previous manually compiled LIGGGHTS® is not enough, it needs to be compiled as shared library with the cfdemCompLIG command.
As step by step compilation of only specific parts, the following commands are available:
cfdemCompLIG cfdemCompCFDEMsrc cfdemCompCFDEmsol cfdenCompCFDEMuti
The compilation is automatically logged and the logs can be found in:
$CFDEM_SRC_DIR/lagrangian/cfdemParticle/etc/log
In case questions concerning the installation arise, please feel free to contact our forum at www.cfdem.com
Run your own cases
If you want to run your own cases, please do so in $CFDEM_PROJECT_USER_DIR/run which is automatically being generated. E.g. copy one of the tutorial cases there, adapt it to your needs. Changes in $CFDEM_TUT_DIR might be lost after every git stash.
You can run all the tutorial cases by executing the alias cfdemTestTUT. Alternatively you can run each tutorial using the Allrun.sh scripts in the tutorial directories.
To run pure LIGGGHTS® cases, you can use the aliases
cfdemLiggghts inputScriptName cfdemLiggghtsPar inputScriptName nOfProcs
or you can set a link in /usr/local/bin to the LIGGGHTS® executable as described in the LIGGGHTS®documentation .
Problems:
文件无法下载或下载缓慢
可能与访问 Github 速度有关
- 将
git://
修改为https://
- 将
https://github.com
修改为https://ghproxy.com/https://github.com
环境配置问题
- 从
$HOME/CFDEM/CFDEMcoupling-PUBLIC-$WM_PROJECT_VERSION/src/lagrangian/cfdemParticle/etc/bashrc
复制对应内容,解除注释后放到~/.bashrc
末尾
source ~/.bashrc
运行定义环境变量