CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Problem starting OpenFoam 2.2.2. (https://www.cfd-online.com/Forums/openfoam-installation/128886-problem-starting-openfoam-2-2-2-a.html)

Marcus_L January 23, 2014 09:07

Problem starting OpenFoam 2.2.2.
 
I had an old version of OF on Ubuntu and guess i moved something around because i couldn't start it. So I simply removed the OpenFoam folder in the Home directory and reinstalled the new version 2.2.2. The old version was 2.1.0,

But trying to open using icoFoam i get the following:

--> FOAM FATAL IO ERROR:
cannot find file

file: /home/marcus/OpenFOAM/marcus-2.1.0/run/system/controlDict at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.


So it tries to open the old version of openfoam ?

I followed these instructions when installing, both times.
http://www.openfoam.org/download/ubuntu.php

Any ideas?

alexeym January 23, 2014 09:37

Hi,

Quote:

Originally Posted by Marcus_L (Post 471423)
--> FOAM FATAL IO ERROR:
cannot find file

file: /home/marcus/OpenFOAM/marcus-2.1.0/run/system/controlDict at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.

Actually it tries to find case files. I guess you're trying just run icoFoam in $FOAM_RUN folder, while you need to run it in case folder.

Marcus_L January 23, 2014 09:45

Thank you.

It seems I have two versions of OF installed now, looking in the /opt directory. What is the best way to get rid of the old version ?

alexeym January 23, 2014 09:49

If you installed old version with a package manager, you can use the package manager to uninstall it.

Guess on Ubuntu it should be something like 'dpkg -r openfoam211'

alexeym January 23, 2014 09:51

Though it seems that you're still using old version (2.1.0). Are you sure, you've corrected shell initialization file to source bashrc of new version?

Marcus_L January 23, 2014 09:56

Thank you for your help.

I removed the 2.1.0. version but when I try the "mkdir -p $FOAM_RUN " command it still makes a folder with 2-1-0 in it, why is $FOAM_RUN still connected to the old version number?
Same problem with icoFoam command, it also looks for the old version folders?

Marcus_L January 23, 2014 09:59

Quote:

Originally Posted by alexeym (Post 471445)
Though it seems that you're still using old version (2.1.0). Are you sure, you've corrected shell initialization file to source bashrc of new version?

yes in the bashrc the line added is source /opt/openfoam222/etc/bashrc

alexeym January 23, 2014 10:05

Did you remove source /opt/openfoam210/etc/bashrc line?
As there can be lots of reasons (from you're still using old shell session with old environment variables), we'll spend much time guessing what has really happened. Can you describe the way you've made upgrade? Can you show relevant parts of your .bash_profile?

Marcus_L January 23, 2014 10:11

You said old shell sessions so I tried just restarting the terminal. And now it's updated to the 2-2-2 version.

The only thing is when I just type icoFoam and I get an error about it not finding something in a directory where I originally moved the 2.1.0. version to, which was the whole error from the start.

Maybe this isn't even an issue when I got a real case running, working in that case folder?

alexeym January 23, 2014 10:15

Maybe. Just try:

Code:

$ cd $FOAM_RUN
$ cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity .
$ cd cavity
$ blockMesh
$ icoFoam


Marcus_L January 23, 2014 10:22

when i try to cp the cavity directory it just says it's ommitting the cavity directory, not allowing the cp.

alexeym January 23, 2014 10:24

I forgot -r flag for cp, it should be

Code:

$ cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity .

Marcus_L January 23, 2014 10:40

Yea it seems to run when going at a case.

Thank you very much for your help.

vasava January 24, 2014 02:01

If you have multiple versions of openfoam installed then it is advisable to have alias for each version and then 'activate' version before running the simulation.

alias is a short name that you use for a command. Its like a hyperlink in windows. You can go through this link (http://openfoamwiki.net/index.php/In...M-2.2.2/Ubuntu) for installing openfoam and this link (http://openfoamwiki.net/index.php/In...nFOAM_versions) for alias.

Once you have made the alias (e.g. of222 for openfoam 2.2.2 and of22x for openfoam 2.2.x) then you can activate any version by of222+enter or of22x+enter.

Marcus_L January 24, 2014 06:12

Thank you, but I uninstalled the old version, why would you want two versions anyway ?


All times are GMT -4. The time now is 07:38.