Run BinFlow example

Submitted by govind on Sun, 07/02/2017 - 16:11

Hi,
I am just new to LIGGGHTS and start learning with example. I want to run Binflow simulation given in tutorials but do not know how to run it. Input script. I had run the simulations given in examples folder but these example contain other things also beside input script such as runPost script etc.
In Binflow only input script is there.

govind | Sun, 07/09/2017 - 11:57

Any source for stl files for examples?

j-kerbl's picture

j-kerbl | Mon, 07/17/2017 - 14:29

Hi Govind,

I am not sure where you obtained the binflow tutorial, but it isn't among the officially supported tutorials. You can see the list in your local examples folder of your LIGGGHTS installation, or here: https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/tree/master/examples/LIGGGHTS/Tutorials_public

Where did get this tutorial?

Cheers,
Josef

govind | Thu, 07/20/2017 - 08:52

Thank you josef

Now I am able run liggghts simulations and got stl files also. Beginning was tough but now its not that much tough.

govind | Thu, 07/20/2017 - 09:24

Hi josef,

Can you tell me about parallel run ? While installing liggghts I have followed the instructions :

##Installing Libraries g++ and git-core

sudo apt-get install libvtk5-dev libeigen2-dev libopenmpi-dev g++ git-core

Following two lines have helped me trobleshooting some errors in installing in ubuntu 14. (Instead of make ubuntuVTK, I tried make fedora for this case).
sudo apt-get install build-essential git
sudo apt-get install openmpi-common openmpi-bin libopenmpi-dev

##Checking installations
which mpirun
/usr/bin/mpirun comes up?
which mpic++
/usr/bin/mpic++ comes up?
mpic++ -v
gcc-Version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) comes up at the last line?

##Installing cmake
sudo apt-get install cmake
sudo apt-get install cmake-curses-gui
##Installing VTK

Download vtk-5.8.0.tar.gz from http://www.vtk.org/VTK/resources/software.html#previous2
Note: If VTK-5.8 not found then download it from here https://www.dropbox.com/s/t2q569ykfygpqej/VTK-5.8.tar.gz?dl=0
Extract downloaded folder into home directory
cd /home/"user"/VTK
rm CMakeCache.txt [optional]
sudo cmake .
Note: (a) If encountered error such as In file included from /usr/include/GL/glx.h:333:0,
from /home/rahul/VTK-5.8/Rendering/vtkXOpenGLRenderWindow.cxx:31:
/usr/include/GL/glxext.h:480:143: error: ‘GLintptr’ has not been declared
eadCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr re then either follow at http://stackoverflow.com/questions/28761702/getting-error-glintptr-has-n... or open VTK-directory/Rendering/vtkXOpenGLRenderWindow.cxx and then uncomments the line with text #define GLX_GLXENT_LEGACY and perform sudo make
(b) If you find difficulty or error in configuring, it is recommended to change INSTALL_PREFIX. Do ccmake /home/"user"/VTK, and then change the CMAKE_INSTALL_PREFIX from /usr/local to /usr. Then, enter c to configure and g to generate.
(c) If you find the error error: 'S_IFLNK' undeclared (first use in this function) then a small commit (http://www.paraview.org/Bug/view.php?id=12568) can fix the issue. Refer to https://sites.google.com/site/rahuliitdhn/liggghts/vtk-compilation-errors
(d) In any case, if you encounter an error of following type:
CMake Error at VTK/CMake/vtkCompilerExtras.cmake:47 (if):
if given arguments:
"gcc: error: ARGS: No such file or directory
gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3)
Then, edit file VTK/CMake/vtkCompilerExtras.cmake for string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" to string (REGEX MATCH "[3456]\\.[0-9]\\.[0-9]*". More info at https://www.cfd-online.com/Forums/openfoam-installation/175841-openfoam-...

sudo make
sudo make install
The last instructions will install .h, .a and .cmake files under /usr/local, such as /usr/local/include/vtk-5.8 and /usr/local/lib/vtk-5.8. For convenience of upgrading, it would be useful to create symbolic links (short cut) of /usr/local/include/vtk-5.8 and /usr/local/lib/vtk-5.8 in the global environment:
cd /usr/local/include
sudo ln -s vtk-5.8 vtk (It will create a symbolic link named vtk of vtk-5.8 inside /usr/local/include)
cd /usr/local/lib/
sudo ln -s vtk-5.8 vtk
After installing VTK, go to the directory where cmake is installed, e.g. /usr/share/cmake-2.8. Then, go to the subdirectory Modules and open the file FindVTK.cmake and you will see the following lines:
# The following cache entries must be set by the user to locate VTK:
# VTK_DIR - The directory containing VTKconfig.cmake.
At the end of the messages (it could be after (# License text for the above reference.)) add in a new line:
SET (VTK_DIR "/usr/local/lib/vtk") (Note: This step is generally not required for cmake version 3.0 or more)
##Installing LIGGGHTS

git clone https://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git $HOME/LIGGGHTS-PUBLIC

##Compiling LIGGGHTS with jpg, png support
gedit /$HOME/LIGGGHTS-PUBLIC/src/MAKE/Makefile.ubuntuVTK
In the line that defines LMP_INC switch: at the end add a tab followed by "-DLAMMPS_JPEG -DLAMMPS_PNG"
In the line that defines JPG_INC switch add at the end "-I/usr/include"
In the line that defines JPG_LIB switch add at the end "-ljpeg -lpng "
In the line that defines VTK_INC switch replace vtk version 5.2 with installed version 5.8 (or if any other is installed, better to check the version inside directory /usr/include/)
Note: Sometimes VTK might have been installed in a slightly different location, that depends on its configuration at the first stage. In such a case LIGGGHTS shall not be able to find it, and thus, it will throw error such as
../dump custom vtk: fatal error: vtkSmartPointer.h: No such file or directory
Then, check the VTK location whether it /usr/include/ or /usr/local/include then make appropriate changes in the Makefile line. e.g. VTK_INC = -I/usr/local/include/vtk-5.8
Similarly, for creating movie file add "-DLAMMPS_FFMPEG" after a tab in LMP_INC switch line. For this you will need FFMPEG package in Ubuntu. See http://www.ffmpeg.org/download.html and http://ubuntuforums.org/showthread.php?t=2219550 for installing FFMPEG in Ubuntu. Or else, you can enter following command:
sudo add-apt-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
sudo apt-get install ffmpeg
sudo apt-get install frei0r-plugins
or
if [ $(cat /etc/*-release | grep "DISTRIB_CODENAME=" | cut -d "=" -f2) == 'trusty' ];
then sudo add-apt-repository 'deb http://ppa.launchpad.net/jon-severinsson/ffmpeg/ubuntu trusty main' && sudo add-apt-repository 'deb http://ppa.launchpad.net/jon-severinsson/ffmpeg/ubuntu saucy main' && sudo apt-get update
fi]

cd /home/"user"/LIGGGHTS-PUBLIC/src
sudo make clean-all
sudo make ubuntuVTK or make fedora
For problem compiling liggghts 3.0 or more please refer to http://www.cfdem.com/forums/compile-problems
After successful compiling liggghts:
sudo ln -s /$HOME/LIGGGHTS-PUBLIC/src/lmp_ubuntuVTK /usr/bin/liggghts
or
sudo gedit ~/.bashrc
Add following lines (with appropriate path) at the end of file and save it.
alias "liggghts=/path to LIGGGHTS-PUBLIC/src/lmp_ubuntuVTK"

Open new terminal and type
liggghts
Liggghts comes up, telling version, compiling date etc.
ctrl+d
##Checking LIGGGHTS for a simulation

cd /home/"user"/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/chute_wear
liggghts < in.chute_wear
Simulation will create dump files in the post folder.
## Install LPP for postprocessing

sudo apt-get install python-numpy
sudo git clone https://github.com/CFDEMproject/LPP.git $HOME/LPP
gedit ~/.bashrc
add at the bottom alias lpp="python $HOME/LPP/src/lpp.py"
##Checking the lpp installation

Open new terminal
cd /home/"user"/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/chute_wear/post
lpp dump*.chute
.vtk files will be created in the post folder which can be used later for visualization of simulation in paraview.

Alternatively, if you have successfully installed the VTK and compiled LIGGGHTS with VTK support, you can directly write the dump files in vtk format without requiring the vtk conversion as discussed above. An example of such dump command to write directly in vtk is shown below:
dump dump_id group_id custom/vtk dump_frequency post/dump*.vtk id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
Please refer to liggghts manual dump command of cutsom/vtk style for more details.
##Install Syntax Highlighting for gedit

cd ~
wget https://sites.google.com/site/rahuliitdhn/files-1/language-specs.tar.gz?...
Extract the downloaded file or run tar -zxvf language-specs.tar.gz?...
sudo mv $HOME/language-specs/liggghts.lang /usr/share/gtksourceview-3.0/language-specs
##Installing paraview

Note: sudo apt-get install paraview install an older version of paraview, which in my case was crashing while opening a .stl file. .stl file represents geometry in LIGGGHTS simulation. I don't about others but in my case it was crashing. So, I decided to install paraview 4.

Download the latest binary installer tar.gz file of paraview from http://www.paraview.org/paraview/resources/software.php
Extract the tar.gz file in the same directory
cd /home/"user"/Downloads {if the tar.gz is downloded in Downloads directory otherwise cd to appropriate directory}
sudo cp -r ParaView-4.0.1-Linux-32bit /opt/ {Check the folder name for any corrections; make corrections according to 64 bit version}
Check if it is installed by
cd ~
/opt/ParaView-4.0.1-Linux-32bit/bin/paraview {correct for 64 bit paraview, check the exact folder name in /opt/}
Paraview should open up now
Add the PATH to bashrc file, so that paraview opens only by entering paraview
gedit ~/.bashrc
Add the following line at bottom
export PATH=/opt/ParaView-4.0.1-Linux-32bit/bin/:$PATH {correct for 64bit paraview}
Check if paraview installed by entering paraview in new terminal. Check the version of paraview at the top.
Note: (a) if received error like /opt/ParaView-4.4.0-Qt4-Linux-64bit/lib/paraview-4.4/paraview: error while loading shared libraries: libGenericIO.so: cannot open shared object file: No such file or directory. It is caused by shared library issue especially in Paraview-4.4Qt4.
Enter the following commands
cd
sudo chmod -R a+rx /opt/ParaView-4.4.0-Qt4-Linux-64bit/
(b) if you have installed any other version of paraview earlier then opening paraview through Dash Home may open a different version.
##Checking the simulated results
In paraview, open folder /home/"user"//LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/chute_wear then select all .stl files. Again, in paraview open folder /home/"user"/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/chute_wear/post and open all .vtk files.
Click on Apply they play simulation.
##Enabling parallel processing in LIGGGHTS

see processors command in manual to add feature in in.script
gedit ~/.bashrc
add at the bottom export WM_NCOMPPROCS=2 (where is the number of processors in your pc)
command to initiate simulation with parallel computing mpirun -np 2 liggghts -in in.script

but do not work to run in parallel

Govind

j-kerbl's picture

j-kerbl | Fri, 07/21/2017 - 13:40

Hi Govind,

your installation procedure and your tutorial case are from the community, not written for the current LIGGGHTS version and not directly supported by us, but I will try to help you.
The official instructions are here: https://www.cfdem.com/media/DEM/docu/Section_start.html#making-liggghts-r-public

Also please stop adding your comments to other topics and let's focus on this thread.

Since I've read in another post your parallel run is working now, but the dump custom/vtk isn't. You can replace "dump xxxxx custom/vtk dump*.vtk" with "dump xxxxx custom dump*.dump" and it should run. However, you have to use lpp on the produced *.dump files to generate the vtk files, readable by paraview.
In the tutorial above VTK is mentioned, have you installed VTK on your system? If yes, which version and where? Which OS do you have?

Cheers,
Josef

govind | Sat, 07/22/2017 - 08:56

With "make auto" , it finishes compilation with this :

size ../lmp_auto
text data bss dec hex filename
20773055 568888 864 21342807 145aa57 ../lmp_auto
make[1]: Leaving directory '/home/dhiraj/LIGGGHTS-PUBLIC/src/Obj_auto'

but I get lmp_auto file. Is this okay with compilation or something is missing?

Govind

govind | Fri, 07/21/2017 - 16:02

HI ,

Thank you. VTK version is 5.8 and I am using ubuntu 16.04LTS. I will update my LIGGGHTS from official instructions.

For the case of parallel run , it runs in parallel mode but taking longer time than serial mode. I am solving couette cylinder simulation from LIGGGHTS tutorials and using 4 processors
I have tried with different combinations of command "processors" like 1 1 4 , 1 2 2 , 2 2 , 1 4 1. I have read somewhere in forum that compile LIGGGHTS with " make openmpi " it works but When
I compile with make openmpi , it results in error. But compile with "make fedora" , it doesn't give any error.

Govind

govind | Fri, 07/28/2017 - 15:06

No speed up in parallelization or slower than serial because of I am using public version of LIGGGHTS ?

Govind

alice's picture

alice | Thu, 08/24/2017 - 14:00

Hello Govind,
did you run the case in parallel using the command "mpirun -np {NUMBER OF PROC} liggghts < {INPUT SCRIPT NAME}? (Please check the command "processors x y z" in the LIGGGHTS docu as well)?
Parallelization is also available for the PUBLIC version and unless the used test case is not particularly unsuitable for parallelization (e.g. all particles are accumulated in a very small region of the computational domain and thus end up on the same processor again) it was proven to scale very well...
Cheers,
Alice

govind | Tue, 08/29/2017 - 06:11

Thank you Alice

Can it be the reason that I have specified with command "processors 1 2 2" and no dynamic balancing? Because in this simulation particles are in domain and with time they are
discharging and with discharge it may happen that some processors do not have particles. So how do I setup dynamic balancing in input script?

Govind

alice's picture

alice | Thu, 10/05/2017 - 07:41

Hello Govind,
even if some processors do not have any particles it should still help that the particles are distributed over a couple of processors (an to my overservation also does). It is important to chose the decomposition as favourable as possible to your case. Dynamic load balancing is currently not part of the public version.
Cheers,
Alice

alejandro saez | Wed, 05/01/2019 - 23:45

Hello everyone, I tell you that I am a new user in LIGGGHTS, and I am working on a program modeling a system consisting of a belt, barriers, box and board. In the latter, the particles fall to the belt that moves at 5 m / s, where they are finally deposited in the box. However, the program does not run, because the following messages appear:

"0 atoms group group" ... .. (does the "group" command work correctly?)
"Error on proc 0: Too many neighbor bins (../neigbor.cpp:1776) .......... (What happens to the neighbors?)

Two other situations that complicate me, occurs in the global variables:
First: The coefficient of restitution does not allow entering the number zero as a value, so I used the value 0.6e-1. Why does this situation happen?
Second: In Young's module, if values of the order of 1e9 are taken, it forces me to take the condition of "hard particles". Why does this situation happen?

This is the program. Please, I need help to solve this problem and make the program run. I do not know what is happening.

Best regards to all.

# Program name: ejemplo_punto_transferencia

## Initialization of parameters

atom_style granular
atom_modify map array
hard_particles yes
boundary m m m
newton off
communicate single vel yes
units si
region reg block -0.60 0.10 -2.85 0.10 -0.20 1.40 units box
create_box 4 reg
neighbor 0.002 bin
neigh_modify delay 0
#neigh_modify delay 0 binsize 0.01
#neigh_modify every 1 check no

## Physical model

pair_style gran model hertz tangential history rolling_friction cdt
pair_coeff * *
timestep 9.37e-6
fix gravedad all gravity 9.81 vector 0.0 0.0 -1.0

## Material properties.

fix m1 all property/global youngsModulus peratomtype 250.e6 2.7e9 182.e9 100.e6
fix m2 all property/global poissonsRatio peratomtype 0.38 0.35 0.3 0.45
fix m3 all property/global coefficientRestitution peratomtypepair & 4 0.7 0.65 0.66 0.4 0.65 0.6e-1 0.6e-1 0.6e-1 0.66 0.6e-1 0.6e-1 0.6e-1 0.4 0.6e-1 0.6e-1 0.6e-1
fix m4 all property/global coefficientFriction peratomtypepair 4 & 0.3 0.32 0.27 0.7 0.32 0 0 0 0.27 0 0 0 0.7 0 0 0
fix m5 all property/global coefficientRollingFriction peratomtypepair 4 0.1 0.2 0.2 0.2 0.2 0 0 0 0.2 0 0 0 0.2 0 0 0

## CAD geometry.

fix correa all mesh/surface file meshes/correa.stl type 4 surface_vel 0 5 0
fix barreras all mesh/surface file meshes/barreras.stl type 2
fix caja all mesh/surface file meshes/caja.stl type 3
fix placa all mesh/surface file meshes/placa.stl type 2
fix sistema all wall/gran model hertz tangential history rolling_friction cdt mesh n_meshes 3 meshes correa barreras caja

## Insert particles.

group grupo region reg # (This does not recognize him does not understand the program when running)

fix pellet all particletemplate/sphere 15485863 atom_type 1 density constant 925 radius constant 0.028
fix pellets all particledistribution/discrete 32452843 1 pellet 1.0
fix insertar_particulas grupo insert/stream seed 32452867 & distributiontemplate pellets & nparticles 100000 massrate 11.39 insert_every 10000 overlapcheck &
yes all_in no vel constant 0.0 0.0 -1.0 insertion_face placa

## Calculations and output variables

fix integrar grupo nve/sphere
compute rke all erotate/sphere
thermo_style custom step atoms ke c_rke vol
thermo 1000
thermo_modify lost ignore norm no

## Run the simulation and record output information.

run 1
dump dmp all custom 1000 post/dump*.ejemplo_punto_transferencia id & type mass x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
run 747065 upto

alejandro saez | Wed, 05/01/2019 - 23:52

The particles fall vertically from the plate with speed -1 m / s to the belt. The belt moves at 5 m / s to transport the particles so that they are deposited in the box.

Do you need me to send you the files in STL format?