CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OpenFoam 1.7.1 in Ubuntu 10.04 won't start working (http://www.cfd-online.com/Forums/openfoam-installation/79772-openfoam-1-7-1-ubuntu-10-04-wont-start-working.html)

Leech September 3, 2010 04:47

OpenFoam 1.7.1 in Ubuntu 10.04 won't start working
 
Hi everyone!

I'm new to this forum, so hello everyone.
I am hoping to find some help here, because OpenFoam won't finally start working.
As mentioned above i am trying to install OpenFOAM 1.7.1 on Ubuntu 10.04. For both i am using the 64bit versions.
Naturally i followed the user guide http://www.openfoam.com/download/ubuntu.php
As they want i downloaded all the stuff by using apt-get and then installed it. I edited the Bashrc in how i guess the right way and tried to type icoFOAM -help and got the usage message. So everything is fine till this point.
In the next step they want me to build user directories so i can't crush the OpenFOAM opt-dir. I tried using mkdir -p $FOAM_RUN but my system was not doind anything and also didn't created the directory. So i got it manually
Code:

sudo mkdir FOAM_RUN
. Then i changed into this folder and tried to use
Code:

cp -r $FOAM_TUTORIALS $FOAM_RUN
but he said something like some folders doesn't exist. So again i changed my input to
Code:

sudo cp -r $FOAM_TUTORIALS ./
. And finally it worked. Then i was going ahead to the cavity folder and tried to type in blockMesh and he started working. Then he got me an error message :
Code:

Writing polyMesh


--> FOAM FATAL ERROR:
Failed writing polyMesh.

    From function blockMesh
    in file blockMeshApp.C at line 345.

FOAM exiting

So now i am confused. What made me curious (?) was that he couldn't use the commands mentioned in the install link. But i guess it won't be a problem that i built the directories in my home folder manually?
So i guessed that there was something wrong with my environment variables. I typed in
Code:

env
and he gave me a lot of variables for OpenFOAM but i couldn't figure out he problem. So i will copy the env list here:
Code:

pierre@pierre-desktop:~/OpenFOAM/pierre-1.7.1/FOAM_RUN/tutorials/incompressible/icoFoam/cavity$ env
WM_LINK_LANGUAGE=c++
MANPATH=:
ORBIT_SOCKETDIR=/tmp/orbit-pierre
FOAM_SOLVERS=/opt/openfoam171/applications/solvers
FOAM_APPBIN=/opt/openfoam171/applications/bin/linux64GccDPOpt
SSH_AGENT_PID=1238
FOAM_TUTORIALS=/opt/openfoam171/tutorials
FOAM_JOB_DIR=/opt/jobControl
WM_ARCH=linux64
WM_OSTYPE=POSIX
TERM=xterm
SHELL=/bin/bash
FOAM_LIB=/opt/openfoam171/lib
WM_THIRD_PARTY_DIR=/opt/ThirdParty-1.7.1
XDG_SESSION_COOKIE=4b34e93ee1e0777777bb44e74c77edad-1283499851.532413-311471994
FOAM_SITE_APPBIN=/opt/site/1.7.1/bin/linux64GccDPOpt
WINDOWID=67108868
PLIBS=-pthread -L/usr/lib/openmpi/lib -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl
OLDPWD=/home/pierre/OpenFOAM/pierre-1.7.1/FOAM_RUN/tutorials/incompressible/icoFoam
GNOME_KEYRING_CONTROL=/tmp/keyring-zz1qB8
FOAM_MPI_LIBBIN=/opt/openfoam171/lib/linux64GccDPOpt/openmpi-system
GTK_MODULES=canberra-gtk-module
FOAM_APP=/opt/openfoam171/applications
WM_CXXFLAGS=-m64 -fPIC
WM_CFLAGS=-m64 -fPIC
WM_PROJECT_VERSION=1.7.1
USER=pierre
FOAM_SITE_LIBBIN=/opt/site/1.7.1/lib/linux64GccDPOpt
LD_LIBRARY_PATH=/opt/paraviewopenfoam380/lib/paraview-3.8:/opt/openfoam171/lib/linux64GccDPOpt/openmpi-system:/usr/lib/openmpi/lib:/home/pierre/OpenFOAM/pierre-1.7.1/lib/linux64GccDPOpt:/opt/site/1.7.1/lib/linux64GccDPOpt:/opt/openfoam171/lib/linux64GccDPOpt:/opt/openfoam171/lib/linux64GccDPOpt/dummy
LS_COLORS=rs=0:di=01;34:ln=01;36:hl=44;37: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:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=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:*.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:
MPI_BUFFER_SIZE=20000000
WM_COMPILER_LIB_ARCH=64
FOAM_SRC=/opt/openfoam171/src
FOAM_SIGFPE=
ParaView_DIR=/opt/paraviewopenfoam380
WM_PROJECT_INST_DIR=/opt
FOAM_UTILITIES=/opt/openfoam171/applications/utilities
WM_CXX=g++
WM_PROJECT_DIR=/opt/openfoam171
SSH_AUTH_SOCK=/tmp/keyring-zz1qB8/ssh
DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
SESSION_MANAGER=local/pierre-desktop:@/tmp/.ICE-unix/1204,unix/pierre-desktop:/tmp/.ICE-unix/1204
USERNAME=pierre
WM_PROJECT=OpenFOAM
XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
WM_LDFLAGS=-m64
WM_COMPILER=Gcc
WM_MPLIB=SYSTEMOPENMPI
DESKTOP_SESSION=gnome
PATH=/opt/paraviewopenfoam380/bin:/home/pierre/OpenFOAM/pierre-1.7.1/applications/bin/linux64GccDPOpt:/opt/site/1.7.1/bin/linux64GccDPOpt:/opt/openfoam171/applications/bin/linux64GccDPOpt:/opt/openfoam171/wmake:/opt/openfoam171/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
FOAM_USER_LIBBIN=/home/pierre/OpenFOAM/pierre-1.7.1/lib/linux64GccDPOpt
WM_CC=gcc
PWD=/home/pierre/OpenFOAM/pierre-1.7.1/FOAM_RUN/tutorials/incompressible/icoFoam/cavity
GDM_KEYBOARD_LAYOUT=de
LANG=de_DE.UTF-8
MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
GDM_LANG=de_DE.UTF-8
PV_PLUGIN_PATH=/opt/openfoam171/lib/linux64GccDPOpt/paraview-3.8
FOAM_INST_DIR=/opt
FOAM_LIBBIN=/opt/openfoam171/lib/linux64GccDPOpt
WM_COMPILE_OPTION=Opt
GDMSESSION=gnome
ParaView_VERSION=3.8.0
PINC=-I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread
WM_DIR=/opt/openfoam171/wmake
SPEECHD_PORT=7560
SHLVL=1
HOME=/home/pierre
ParaView_MAJOR=3.8
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=pierre
WM_PROJECT_USER_DIR=/home/pierre/OpenFOAM/pierre-1.7.1
FOAM_RUN=/home/pierre/OpenFOAM/pierre-1.7.1/run
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-oSoGOsEDKD,guid=cbed7f4b3096dafbc718d2d54c80a74b
WM_OPTIONS=linux64GccDPOpt
LESSOPEN=| /usr/bin/lesspipe %s
DISPLAY=:0.0
WM_PRECISION_OPTION=DP
WM_ARCH_OPTION=64
LESSCLOSE=/usr/bin/lesspipe %s %s
FOAM_USER_APPBIN=/home/pierre/OpenFOAM/pierre-1.7.1/applications/bin/linux64GccDPOpt
XAUTHORITY=/var/run/gdm/auth-for-pierre-MbGJIt/database
COLORTERM=gnome-terminal
_=/usr/bin/env

So i hope anyone is understanding what my problem is (English isn't my main language as you recognized for sure). And i would be very glad if anyone can help me.

So thanks anyone.
Leech

wyldckat September 3, 2010 19:38

Greetings Leech and welcome to the forum!

There is something very strange going on with your Ubuntu installation :(

But lets start at the beginning of your problems:
Quote:

I tried using mkdir -p $FOAM_RUN but my system was not doind anything and also didn't created the directory.
If it didn't complain, then it did create it! Let me explain what the $ is for: it indicates to the shell that the next word to the right of it is a variable, thus it should use the content of the variable instead of name itself. In your case, if you look at your env output, you'll see that:
Code:

FOAM_RUN=/home/pierre/OpenFOAM/pierre-1.7.1/run
Now if you run:
Code:

ls -l $FOAM_RUN
and if it returns:
Code:

total 0
or it shows that the tutorials folder exists in it, then it means that the folder did get created!

Quote:

Then i changed into this folder and tried to use
Code:

cp -r $FOAM_TUTORIALS $FOAM_RUN
but he said something like some folders doesn't exist. So again i changed my input to
Code:

sudo cp -r $FOAM_TUTORIALS ./

What a confusion... you went from "good way" to "bad way" in one step. OK, one issue at a time:
  • he said something like some folders doesn't exist - this is odd, it should have worked... are you sure you didn't miss any "$"?
  • sudo cp ... - uhm, bad move! The sudo command is for super user powers, namely root powers. By using sudo, you've copied the tutorials folder with the wrong permissions :(
But there is an easy way to fix this, simply by running:
Code:

sudo chown -R $USER:$USER $HOME/OpenFOAM/$USER-1.7.1/tutorials
If you didn't miss any characters, it should all work well now.

A word of (exaggerated) advice: working with Linux systems is similar to handling nitroglycerin... one wrong move and BOOOM!
OK, it isn't that sensitive, but it is case sensitive. For example: icoFoam and icoFOAM aren't the same commands in Linux! It is as sensitive as if you were programming C, C++ or C# and so on.
If you think this is bad... well, this is actually an eye opener, because if you aren't careful with what you type now, you probably won't be careful setting the boundary conditions for your future cases to be solved with OpenFOAM! One missing or misplaced dot and your simulation will be as good as GIGO: Garbage In - Garbage Out.

So, be veeeeery careful with what you type and check two or three times what you type, at least until you get the handle of it. Otherwise, you're in for a lot of suffering and hair pulling :(

Best regards and good luck!
Bruno

Leech September 4, 2010 08:09

Hello wyldckat,

thank you so much for your answer and your help. BlockMesh is working now!

But from the beginning:
First of all i removed the folders i created by "hand" and again tried the commands using the $-icons. And as you said he didn't complaint and he returnt total 0.
Then i used the cp-command and copied the tutorials again. But blockMesh still wasn't worked.
Then i locked forward and used your command
Code:

sudo chown -R $USER:$USER $HOME/OpenFOAM/$USER-1.7.1/tutorials
But he said that this directory doesn't exists. But i found the error. I had to type:
Code:

sudo chown -R $USER:$USER $HOME/OpenFOAM/$USER-1.7.1/run/tutorials
And since then it is working.
:)
So I am very happy right now but i'm wondering what this chown command means?
Maybe you can explain me what it did with my system?

So thank you a lot!
Have a nice weekend
leech

wyldckat September 4, 2010 08:32

Hi Leech,

I'm glad it's working now!
Quote:

Originally Posted by Leech (Post 274004)
So I am very happy right now but i'm wondering what this chown command means?

The command chown means "change ownership". $USER is the variable that holds your user name (the short name, not the complete name). The option "-R" indicates that the command should apply this change recursively, or in other words, it should affect all sub-folders and files contained inside the given folder.

Oh, in case you want to see the contents of a variable (or a couple more), use echo. For example with $USER:
Code:

echo $USER
Whenever you want to know more about a command, run:
Code:

man command
For chown:
Code:

man chown
If you search online for "Linux shell tutorial" and you will find various tutorials on all sorts of things you can do with Linux shells. For instance, this one looks good for starting with: Learning the shell. The introduction is quite amusing too :)

A nice weekend to you too and happy reading ;)
Bruno

Leech September 4, 2010 08:39

Ok, thanks again and seems like it's time for me to finally learn the shell internals.

Have a nice day.
Bye
leech

CharlieSeviour December 20, 2011 11:04

Following the instrutions
you end up in the default folder for 2.1.0 but it is necesary to run the tutorial from 1.7.1
i.e /OpenFOAM/charlie-1.7.1/run/tutorials/incompressible/icoFoam/cavity

wyldckat December 21, 2011 16:17

Greetings Charlie,

Quote:

Originally Posted by CharlieSeviour (Post 336485)
Following the instrutions
you end up in the default folder for 2.1.0 but it is necesary to run the tutorial from 1.7.1
i.e /OpenFOAM/charlie-1.7.1/run/tutorials/incompressible/icoFoam/cavity

Uhm, did you check the contents of the file '~/.bashrc'? If you have the following two lines:
Code:

source /opt/openfoam171/etc/bashrc
source /opt/openfoam210/etc/bashrc

Then comment out or remove the first one, like this:
Code:

# source /opt/openfoam171/etc/bashrc
source /opt/openfoam210/etc/bashrc

Then start a new terminal window or tab.

Best regards,
Bruno

lovejerryloveme November 26, 2012 09:43

Hi Leech and wyldckat,

Thank you very much for your discussion and it does help me solve my problem.
But for my case, the command is a little bit different. I post it here as a reference for future foamers,

sudo chown -R $USER $HOME/OpenFOAM/$USER-2.1.1/run/tutorials

Except the version difference, I use "$USER" instead of "$USER:$USER". Maybe it's due to the difference we specify our working directory, but anyway this command works for my case. Thanks again.
Jerry
[QUOTE=Leech;274004]Hello wyldckat,
[CODE]sudo chown -R $USER:$USER $HOME/OpenFOAM/$USER-1.7.1/run/tutorials

siramirsaman August 10, 2014 20:42

Other way
 
I was having the same problem, I used the following commands before running blockMesh and it worked for me:


Code:

sudo -s
su -
exit



All times are GMT -4. The time now is 21:55.