CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [Other] of7 command (https://www.cfd-online.com/Forums/openfoam-installation/233260-of7-command.html)

kalish January 19, 2021 12:26

of7 command
 
Hello, it is my first post around here, I might have to make a presentation somewhere else, so I will make it later.


I tried to install openFoam from that website:


https://openfoamwiki.net/index.php/I...7/Ubuntu/18.04


It seems paraview runs smoothly and when I type


Code:

icoFoam -help
I get


Code:

Usage: icoFoam [OPTIONS]
options:
  -case <dir>      specify alternate case directory, default is the cwd
  -noFunctionObjects
                    do not execute functionObjects
  -parallel        run in parallel
  -roots <(dir1 .. dirN)>
                    slave root directories for distributed running
  -srcDoc          display source code in browser
  -doc              display application documentation in browser
  -help            print the usage

So everything is ok, but then it's written

Code:

Using: OpenFOAM-4.0 (see www.OpenFOAM.org)
Build: 4.0

Ok so the number doesn't seem right. Thus I tried to write


Code:

of7
and nothing happened, neither an error message nor anything.
Since it's written OpenFoam-4.0, I also tried



Code:

of4

La commande « of4 » n'a pas été trouvée, voulez-vous dire :

  commande « ofl » du deb hxtools

Essayez : sudo apt install <nom du deb>

Which means the command wasn't found, do you mean ... in French.
I also tried

Code:

openfoam
openfoam : commande introuvable

I have installed a lot of stuff and I can't figure out why nothing happens when I try to launch the software. It is also not in running in my processes


Thank you.

guin January 19, 2021 18:45

of7 is not a command itself, but an alias for loading the OpenFOAM environment in your session. If you read again the point 8 in https://openfoamwiki.net/index.php/I...7/Ubuntu/18.04 they explain you how to store it in your terminal settings, so that you your systems understands what you mean whenever the order "of7" is requested.

Note that, after installing OpenFOAM, you need to tell your system where to find the executables. It shall be enough to call something like
Code:

source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc
from the terminal before calling OpenFOAM applications. Of course, having to repeat this every time you open a new terminal window is tedious, therefore you typically want to automate this process and that's where the file $HOME/.bashrc can be useful (I assume an out-of-the-box Ubuntu). This is achieved by saving the line
Code:

source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc
inside that file.

Aliases such as the one you mentioned become however useful for avoiding conflicts in case you have more than one OpenFOAM version installed simultaneously on your system, which seems to be your case. They help you to choose among them what precise "icoFoam" do you want to run i.e. from OpenFOAM-7?, -2012,? -ext?, etc.

Keep sure you do not automatically load all the versions simultaneously.

This may further help you https://openfoamwiki.net/index.php/I...nFOAM_versions

kalish January 21, 2021 14:04

Thank you I will check it. I might have several versions on my computer because I tried to install it few times. I think I already wrote that line in the bashrc file. I am struggling to install openfoam, there are some obscure commands even in the very first page of the user guide, how something like
Code:

ls $FOAM_RUN
or
Code:

mkdir -p $FOAM_RUN
can have any meaning, it's not a directory to me. (and it's not here by the way).
https://cfd.direct/openfoam/user-guide/v7-tutorials/

Are those versions 7 or 2012 or 1912 from the same fork?

guin January 22, 2021 07:01

Actually, these both commands are among the most usual ones in UNIX environments...

It may help you to start getting a bit familiar with them.
Take a look here:
https://cfd.direct/openfoam/linux-guide/

and here (scroll down to "Shell variables" sub-section): https://guide.bash.academy/expansions/

kalish January 22, 2021 10:25

I know them, when I type ls, the directory is not here, and mkdir tells me it lacks an argument. I never used them with that kind of syntax.


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