openSUSE under Compile Install OpenFOAM

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.