1

I have installed the OpenFOAM package via

sudo apt install openfoam

on Ubuntu, inside the Windows WSL environment. But I have no idea what version/variant of the FLOSS is installed. I tried the

blockMesh -help

hoping it would give me some information about what I am dealing with but I got the error message:

--> FOAM FATAL ERROR :
      Could not find mandatory etc entry (mode=ugo)
       'controlDict'

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193

2 Answers2

2

You can call the shell function foamVersion (which should be available when you install OpenFOAM):

foamVersion # in my case, the output is: OpenFOAM-v2112

Or simply see the output of the environment variable:

echo $WM_PROJECT_VERSION # in my case, the output is v2112

s.ouchene
  • 1,682
  • 13
  • 31
  • How should I install this script? I don't think that it comes preinstalled with the default Ubuntu package. Does it? – Foad S. Farimani Jan 02 '23 at 10:23
  • The `$WM_PROJECT_VERSION` environment variable is not defined. I get no output. – Foad S. Farimani Jan 03 '23 at 15:02
  • @FoadS.Farimani If you've installed ESI version (e.g OpenFOAM v2112) you need to source it: `source /usr/lib/openfoam/openfoam2112/etc/bashrc` (assuming you're on bash). – s.ouchene Jan 03 '23 at 16:08
  • @FoadS.Farimani: for OpenFOAM 10, you should do something like this: `source /opt/openfoam10/etc/bashrc`. In both cases, you should add the source command to your `~/.bashrc` file. – s.ouchene Jan 03 '23 at 16:09
  • The `/opt/` directory is empty. there is no `openfoam` folder in the `/usr/lib`. I did `find . -name "openfoam" 2>/dev/null` on my root directory and found `/usr/share/openfoam` with the `bashrc` script. Running it I get lots of `No such file or directory` error messages pointing to the `/usr/share/openfoam/bin/` path, which doesn't exist! – Foad S. Farimani Jan 04 '23 at 07:10
  • I posted a follow-up question [here](https://www.cfd-online.com/Forums/openfoam-installation/246949-there-no-bin-folder-inside-installation-directory.html#post842272) – Foad S. Farimani Jan 04 '23 at 13:48
  • @FoadS.Farimani: I think that's not the right way to install openfoam. To install ESI version follow the instructions [here](https://develop.openfoam.com/Development/openfoam/-/wikis/precompiled/debian#ubuntu). For instruction how to install OpenFOAM Foundation version see [here](https://openfoam.org/download/10-ubuntu/) – s.ouchene Jan 04 '23 at 14:57
0

Using the Ubuntu command

apt-cache show openfoam

I understood that I had installed the 1906.191111+dfsg1-2build1 version and the openfoam.com variant. But this is a Ubuntu-specific solution, not a general OpenFOAM solution that works on other operating systems.

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193