How to find the version of OpenFOAM installed on WSL-Ubuntu?

2.2k Views Asked by At

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'

2

There are 2 best solutions below

0
On

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.

7
On

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