Installation problem on ubuntu 10.10

Submitted by juhani aittamaa on Wed, 01/05/2011 - 23:09

Dear all

I was impressed on cfd-dem coupling and tried to use it.

I am running ubuntu 10.10 and several versions of openfoam, but have no experience on lggghts or dem coupling.

I first downloaded lggghts and managed to run LGGGHTS example chute_wear

then i tried to link dem with OF1.6.x

i down loaded cfd-dem using git and managed to compile cfdemCloud scr and make library from it. I also compiled cdfdemSolverPisoExplicit to OFuserapplications library succesfully.

Then i tried to run example case settlingTest, after modifying Allrun.sh as below

-----------------------------------------
#!/bin/bash

#===================================================================#
# allrun script for testcase as part of test routine
# run settlingTest
# Christoph Goniva - Sept. 2010
#===================================================================#

#- define variables
casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
##pizzaPath="$HOME/LAMMPS/pizza-16Mar09/src"
pizzaPath="$HOME/LIGGGHTS/gran_pizza_17Aug10/src"

#- run CFD part in new terminal
gnome-terminal --title='cfdemSolverPiso settlingTest CFD' -e "sh $casePath/CFDrun.sh"
-----------------------------------------

went to case directory and tried to run the case (see below) that got stuck

----------------
juhani@ubuntu2:~/CFDDEM/mycfdem/settlingTest$ ls
Allrun.sh* CFD/ CFDrun.sh* DEM/ DEMrun.sh* functions.sh
juhani@ubuntu2:~/CFDDEM/mycfdem/settlingTest$ ./Allrun.sh
simulation finisehd? ...press enter to proceed

after pressing enter

Pizza.py (1 Oct 2006), a toolkit written in Python
type ? for help, CTRL-D to quit
Loading tools ...
Display not available ... no GUIs
vcr tool did not load:
No module named _tkinter, please install the python-tk package
image tool did not load:
No module named _tkinter, please install the python-tk package
animate tool did not load:
No module named _tkinter, please install the python-tk package
No handlers could be found for logger "OpenGL.Tk"
gl tool did not load:
No module named _tkinter, please install the python-tk package
plotview tool did not load:
No module named _tkinter, please install the python-tk package
Executing file: ./pizzaScriptInit
no dump file specified
StandardError'> with value: no dump file specified
error on line 1 of file ./pizzaScriptInit
error on line 215 of file /home/juhani/LIGGGHTS/gran_pizza_17Aug10/src/dump.py
>

-----------------

i got following failure messages in the other terminal window (document viewer could not show properly)

-----------
/home/juhani/CFDDEM/mycfdem/settlingTest/CFDrun.sh: 11: Bad substitution
/home/juhani/CFDDEM/mycfdem/settlingTest/CFDrun.sh: 19: source: not found
rm: cannot remove `./CFD/0.*': No such file or directory
/home/juhani/CFDDEM/mycfdem/settlingTest/CFDrun.sh: 25: CFDrun: not found
cd: 30: can't cd to octave
rm: cannot remove `cfdemSolverPiso_settlingTest.eps': No such file or directory
/home/juhani/CFDDEM/mycfdem/settlingTest/CFDrun.sh: 36: octave: not found

** (evince:15668): WARNING **: Error stating file '/home/juhani/CFDDEM/mycfdem/settlingTest/cfdemSolverPiso_settlingTest.eps': No such file or directory

** (evince:15668): WARNING **: Error setting file metadata: No such file or directory
-----------

That bad substitution at line 11 comes from following file where casePath is set ***

-----------
#!/bin/bash

#===================================================================#
# allrun script for testcase
# run settlingTest CFD part
# Christoph Goniva - Sept. 2010
#===================================================================#

#--------------------------------------------------------------------------------#
#- define variables
casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" ******************************************************
logpath="$casePath"
headerText="run_cfdemSolverPisoExplicit_settlingTest_CFD"
logfileName="log_$headerText"
solverName="cfdemSolverPisoExplicit"
#--------------------------------------------------------------------------------#

#- include functions
source $casePath/functions.sh

#- clean up case
rm -r $casePath/CFD/0.*

#- call function to run CFD cas
CFDrun $logpath $logfileName $casePath $headerText $solverName
#------------------------------#
# octave

#- change path
cd octave

#- rmove old graph
rm cfdemSolverPiso_settlingTest.eps

#- run octave
octave settlingVelocity.m

#- show plot
evince cfdemSolverPiso_settlingTest.eps
#------------------------------#
-----------

trying casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" at terminal resulted in message

-----------
juhani@ubuntu2:~/CFDDEM/mycfdem/settlingTest$ casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
readlink: missing operand
Try `readlink --help' for more information.
-----------

and looking for readlink --help

-----------
juhani@ubuntu2:~/CFDDEM/mycfdem/settlingTest$ readlink --help
Usage: readlink [OPTION]... FILE
Print value of a symbolic link or canonical file name

-f, --canonicalize canonicalize by following every symlink in
every component of the given name recursively;
all but the last component must exist
-----------

no symbol BASH_SOURCE is defined

here are env variables

printenv
WM_LINK_LANGUAGE=c++
MANPATH=:
ORBIT_SOCKETDIR=/tmp/orbit-juhani
FOAM_SOLVERS=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/applications/solvers
FOAM_APPBIN=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt
FOAM_TUTORIALS=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/tutorials
FOAM_JOB_DIR=/home/juhani/OpenFOAM/jobControl
WM_ARCH=linux64
WM_OSTYPE=POSIX
PVM_RSH=/usr/bin/ssh
GPG_AGENT_INFO=/tmp/seahorse-UdJysx/S.gpg-agent:1960:1
TERM=xterm
SHELL=/bin/bash
MPI_ARCH_PATH=/home/juhani/OpenFOAM/ThirdParty-1.6.x/openmpi-1.3.3/platforms/linux64GccDPOpt
FOAM_LIB=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/lib
WM_THIRD_PARTY_DIR=/home/juhani/OpenFOAM/ThirdParty-1.6.x
XDG_SESSION_COOKIE=34c8ecece6b6af51cf19576149ce4357-1293976791.980321-834992119
FOAM_SITE_APPBIN=/home/juhani/OpenFOAM/site/1.6.x/bin/linux64GccDPOpt
WINDOWID=77608125
ParaView_INST_DIR=/home/juhani/OpenFOAM/ThirdParty-1.6.x/paraview-3.6.1
OLDPWD=/home/juhani/CFDDEM/mycfdem/cfdemSolverPisoExplicit
GNOME_KEYRING_CONTROL=/tmp/keyring-yPTlxd
FOAM_MPI_LIBBIN=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/openmpi-1.3.3
GTK_MODULES=canberra-gtk-module
FOAM_APP=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/applications
WM_CXXFLAGS=-m64 -fPIC
WM_CFLAGS=-m64 -fPIC
WM_PROJECT_VERSION=1.6.x
LC_ALL=C
OPAL_PREFIX=/home/juhani/OpenFOAM/ThirdParty-1.6.x/openmpi-1.3.3/platforms/linux64GccDPOpt
USER=juhani
FOAM_SITE_LIBBIN=/home/juhani/OpenFOAM/site/1.6.x/lib/linux64GccDPOpt
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri:/usr/lib32/fglrx/dri
LD_LIBRARY_PATH=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt/openmpi-1.3.3:/home/juhani/OpenFOAM/ThirdParty-1.6.x/openmpi-1.3.3/platforms/linux64GccDPOpt/lib:/home/juhani/OpenFOAM/juhani-1.6.x/lib/linux64GccDPOpt:/home/juhani/OpenFOAM/site/1.6.x/lib/linux64GccDPOpt:/home/juhani/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt:/usr/lib32
MPI_BUFFER_SIZE=20000000
WM_COMPILER_LIB_ARCH=64
FOAM_SRC=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/src
FOAM_SIGFPE=
ParaView_DIR=/home/juhani/OpenFOAM/ThirdParty-1.6.x/paraview-3.6.1/platforms/linux64Gcc
WM_PROJECT_INST_DIR=/home/juhani/OpenFOAM
FOAM_UTILITIES=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/applications/utilities
WM_CXX=g++
WM_PROJECT_DIR=/home/juhani/OpenFOAM/OpenFOAM-1.6.x
PVM_ROOT=/usr/lib/pvm3
SSH_AUTH_SOCK=/tmp/keyring-yPTlxd/ssh
WM_COMPILER_ARCH=
SESSION_MANAGER=local/ubuntu2:@/tmp/.ICE-unix/1914,unix/ubuntu2:/tmp/.ICE-unix/1914
USERNAME=juhani
DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
WM_PROJECT=OpenFOAM
PVM_ARCH=/usr/lib/pvm3/lib/pvmgetarch
XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
WM_LDFLAGS=-m64
WM_COMPILER=Gcc
WM_MPLIB=OPENMPI
DESKTOP_SESSION=gnome
PATH=/home/juhani/OpenFOAM/ThirdParty-1.6.x/paraview-3.6.1/platforms/linux64Gcc/bin:/home/juhani/OpenFOAM/ThirdParty-1.6.x/openmpi-1.3.3/platforms/linux64GccDPOpt/bin:/home/juhani/OpenFOAM/juhani-1.6.x/applications/bin/linux64GccDPOpt:/home/juhani/OpenFOAM/site/1.6.x/bin/linux64GccDPOpt:/home/juhani/OpenFOAM/OpenFOAM-1.6.x/applications/bin/linux64GccDPOpt:/home/juhani/OpenFOAM/OpenFOAM-1.6.x/wmake:/home/juhani/OpenFOAM/OpenFOAM-1.6.x/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
FOAM_USER_LIBBIN=/home/juhani/OpenFOAM/juhani-1.6.x/lib/linux64GccDPOpt
WM_CC=gcc
PWD=/home/juhani/CFDDEM/mycfdem/settlingTest
GDM_KEYBOARD_LAYOUT=fi
LANG=fi_FI.utf8
GNOME_KEYRING_PID=1895
MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
GDM_LANG=fi_FI.utf8
PV_PLUGIN_PATH=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt
FOAM_INST_DIR=/home/juhani/OpenFOAM
FOAM_LIBBIN=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/lib/linux64GccDPOpt
WM_COMPILE_OPTION=Opt
GDMSESSION=gnome
HISTCONTROL=ignoreboth
ParaView_VERSION=3.6.1
WM_DIR=/home/juhani/OpenFOAM/OpenFOAM-1.6.x/wmake
SPEECHD_PORT=7560
SHLVL=1
HOME=/home/juhani
LANGUAGE=fi_FI:fi:en_GB:en
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=juhani
WM_PROJECT_USER_DIR=/home/juhani/OpenFOAM/juhani-1.6.x
FOAM_RUN=/home/juhani/OpenFOAM/juhani-1.6.x/run
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-LTGZFlpzfi,guid=5fc86a5887ab99d88f93835e00000337
MPI_HOME=/home/juhani/OpenFOAM/ThirdParty-1.6.x/openmpi-1.3.3
WM_OPTIONS=linux64GccDPOpt
LESSOPEN=| /usr/bin/lesspipe %s
WINDOWPATH=7
DISPLAY=:0.0
WM_PRECISION_OPTION=DP
WM_ARCH_OPTION=64
LESSCLOSE=/usr/bin/lesspipe %s %s
FOAM_USER_APPBIN=/home/juhani/OpenFOAM/juhani-1.6.x/applications/bin/linux64GccDPOpt
XAUTHORITY=/var/run/gdm/auth-for-juhani-9k2KAC/database
COLORTERM=gnome-terminal
_=/usr/bin/printenv
juhani@ubuntu2:~/CFDDEM/mycfdem/settlingTest$

file structure is presented in attached printscreen png

at the moment i have no idea how to proceed

AttachmentSize
Image icon Kuvakaappaus-1.png45.57 KB
cgoniva's picture

cgoniva | Sun, 01/09/2011 - 21:55

Hi Juhani!

It seems your problem is related to the bash commands.
(tshan encounered the same problem and posted in the forum at "pull, compile, run CFD-DEM coupling src, solver and testcase")

The Allrun.sh script is not that complicated as it might seem at first glance,
it simply opens two terminals, one for the "CFD" directory, and one for the "DEM" directory.

In the CFD-terminal it executes "cfdemSolverPisoExplicit" (the CFD part of the routine),
whereas in the DEM-terminal it executes "liggghts < in.liggghts_init" (the DEM part of the routine)

both parts of the code then run in a synchronised way, exchanging their data.

The rest is just postprocessing:
the CFD data is converted to VTK format by "foamToVTK"
the DEM data is also coverted to VTK format by the python based tool called pizza.py
You can use the command: "pizza -f pizzaScriptInit"

Both data-sets in VTK format can the be visualized in paraview!

There is also octave used in the script which plots the data protocolled in the DEM/post/velocity.txt file.

Concluding, you can simply open two terminals and execute above commands - that's it.

As a script is quite useful I put the commands together in the script. in order to get the script working in different directories, I used the code: casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
you could replace it by your own path: casePath = ".../mycfdem/settlingTest"

For my Ubuntu 10.04 it was necessary to simply use "bash" instead for "sh" in the Allrun script:
#- run CFD part in new terminal
gnome-terminal --title='cfdemSolverPiso settlingTest CFD' -e "bash $casePath/CFDrun.sh"
#- run DEM part in new terminal
gnome-terminal --title='cfdemSolverPiso settlingTest DEM' -e "bash $casePath/DEMrun.sh"

Hope that helps you further...
Cheers,
Christoph

tshan | Mon, 01/10/2011 - 13:07

Hi, Christoph,

I see...
It works now. Thanks for your kind help!

I could see one particles down and up in Paraview. However, I got this message after I ran CFD part in terminal:

rm: cannot remove `cfdemSolverPiso_settlingTest.eps': No such file or directory
./CFDrun.sh: line 36: octave: command not found

** (evince:3359): WARNING **: Error stating file '/home/tong/Software/mycfdem/settlingTest/CFD/octave/cfdemSolverPiso_settlingTest.eps': No such file or directory

** (evince:3359): WARNING **: Error setting file metadata: No such file or directory

How could I solve these errors? I did not see these eps files after the simulation is done.

Further, by modifying the input files of both openFOAM and liggghts, is that possible to do more complicated examples?

Best,
Tong

cgoniva's picture

cgoniva | Mon, 01/10/2011 - 15:50

Hi Tong!

This *.eps is supposed to be generated by the octave script which is being run.
It is normally removed before the run - if it does not exist, you get this error.

Sure, you can modify the input files and generate more complex cases!
Enjoy!

Chris

tshan | Wed, 01/12/2011 - 14:13

Hi, Chris!

If I want to modify the simple case from one particle to many particles, how could I modify the input files of CFD part? Could you tell me?

Many thanks!

Best,
Tong