Installing OpenFOAM in a system other than Ubuntu requires a compile-and-install approach. The following is a compiled installation with openSUSE as an example.
1 Package Preparation
You need to download two packages:
Openfoam-4.x-version-4.1.tar.gz
Thirdparty-4.x-version-4.1.tar.gz
2 Installing GCC
Start Terminal konsole and enter the command in the terminal:
sudo zypper install gcc
When prompted to enter the password and confirm the installation, the system automatically downloads gcc from the network and installs it.
Test the GCC installation version with the terminal command after installation:
gcc --version
As shown, you can see that the installed GCC version is 6.2.1
OPENFOAM4 installation requires GCC minimum version 4.5, here to meet the requirements.
3 Installing dependent packages
Installing the OpenFOAM Dependency package
Using terminal commands:
sudo zypper install -t pattern devel_C_C++sudo zypper install git-core cmake boost-devel gnuplot mpfr-devel openmpi-devel glu-devel
Installing ParaView Dependency Packages
Using terminal commands:
sudo zypper install libQtWebKit-devel libqt4-devel qt4-assistant-adp-devel qt4-x11-tools
This installation may have to wait a while to see the speed of the network.
4 extracting OpenFOAM files
Start installing OpenFOAM below.
Create a folder under the home path with command OpenFOAM
$HOME/OpenFoam
Unzip downloaded OpenFOAM files and third-party files into the OpenFOAM folder
To modify a file name with a command
cd $HOME /openfoammv openfoam-4 . X-version-4.1 openfoam-4.1 mv Thirdparty-4 . X-version-4.1 thirdparty-4.1
The files in the folder at this time.
5 Modifying environment Variables
Open the file $HOME/.BASHRC file with a text editor and add a statement to the last line of the file
source$HOME/OpenFoam/OpenFOAM-4.1/etc/bashrc
As shown in.
Save the file and enter a command in the terminal to update the environment variables
source$HOME/.bashrc
6 installing third-party software
The third-party software consists mainly of three packages:
Scotch and Pt-scotch: for the decomposition of computed areas in parallel operations, the necessary packages.
ParaView: Used to calculate post-processing, necessary packages.
Cgal Computational Geometry Algorithms Library: The package used by the Advanced grid generator Foamyhexmesh is not required.
Terminal enters ThirdParty-4.1 directory, executes command
cd$HOME/OpenFoam/ThirdParty-4.1./Allwmake
The program starts compiling, and after the compilation is complete.
Enter command to install ParaView
./makeParaView
It takes a long time, you can go to the playground to run a marathon and then come back to do something else:).
After the compilation is complete.
7 Compiling and installing OpenFOAM
Similar to the installation of ParaView, enter the terminal and use the command to install.
cd$HOME/OpenFoam/OpenFOAM-4.1./Allwmake
You can also compile in parallel:
./Allwmake-j
It may take a couple of hours and a marathon to run.
8 test Run
Create a OpenFOAM work path
$FOAM_RUN
Execute the following command to test:
cd$FOAM_RUN$FOAM_TUTORIALS/incompressible/simpleFoam/pitzDailycd pitzDailyblockMeshsimpleFoamparaFoam
At this point, the compilation and installation of OpenFOAM is complete.
?
openSUSE under Compile Install OpenFOAM