Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2 OpenCFD binaries
Valid versions: OF version 16.png
Installing OpenFOAM from binary files is very good if you are a first time user. You
can quickly install the software with minimal complications. The process consists of
five simple steps:
1. Download the binary files
2. Unpack the binary files to your home directory
3. Add environmental variables
4. Test the installation
5. Getting Started
This assumes that you will be installing openFOAM in your home directory. There are
many possible variations on this installation procedure (for example, you don't need to
install to your home directory.) But you should probably go with the simplest method
first time around.
1. Download the following files into this directory. These will install the
compiled binary files, the source code, documentation, example files,
necessary supporting libraries, etc. Everything you would expect in a program.
It just comes in four separate packages
1. OpenFOAM-1.6.General.gtgz
2. OpenFOAM-1.6.linux64GccDPOpt.gtgz
3. ThirdParty-1.6.General.gtgz
4. ThirdParty-1.6.linux64Gcc.gtgz
xzf
xzf
xzf
xzf
OpenFOAM-1.6.General.gtgz
OpenFOAM-1.6.linux64GccDPOpt.gtgz
ThirdParty-1.6.General.gtgz
ThirdParty-1.6.linux64Gcc.gtgz
Congratulations. You now have the binary files unpacked. That was most of the work.
Next, you just need to add the environmental variables.
Then update the environment variables by sourcing the $HOME/.bashrc file by typing
in the terminal:
. $HOME/.bashrc
Notice the periods at the beginning of the line and before the .bashrc filename.
OR if running tcsh or csh, source the etc/cshrc file by adding the following line to the
end of your $HOME/.cshrc file:
source $HOME/OpenFOAM/OpenFOAM-1.6/etc/cshrc
Then update the environment variables by sourcing the $HOME/.cshrc file by typing
in the terminal:
source $HOME/.cshrc
Note If you are in doubt about which shell you are running, type:
echo $SHELL
You will know you have done it correctly if you don't get any return from the
command line when you source your .bashrc file. See this example:
> . $HOME/.bashrc
>
That will execute the script. A successful test will produce output that looks like this:
Checking basic setup...
-----------------------------------------------------------------------------Shell:
bash
Host:
linux-hhqc
OS:
Linux version 2.6.27.7-9-default
-----------------------------------------------------------------------------Checking main OpenFOAM env variables...
-----------------------------------------------------------------------------Environment_variable Set_to_file_or_directory
Valid
Crit
-----------------------------------------------------------------------------$WM_PROJECT_INST_DIR /home/nicholas/OpenFOAM
yes
yes
$WM_PROJECT_USER_DIR /home/nicholas/OpenFOAM/nicholas-1.6
yes
no
$WM_THIRD_PARTY_DIR /home/nicholas/OpenFOAM/ThirdParty-1.6
yes
yes
-----------------------------------------------------------------------------Checking the OpenFOAM env variables set on the PATH...
-----------------------------------------------------------------------------Environment_variable Set_to_file_or_directory
Valid
Path Crit
-----------------------------------------------------------------------------$WM_PROJECT_DIR
/home/nicholas/OpenFOAM/OpenFOAM-1.6
yes
yes yes
$FOAM_APPBIN
...1.6/applications/bin/linux64GccDPOpt yes
yes yes
$FOAM_SITE_APPBIN
...penFOAM/site/1.6/bin/linux64GccDPOpt no
no
$FOAM_USER_APPBIN
...1.6/applications/bin/linux64GccDPOpt no
no
$WM_DIR
...nicholas/OpenFOAM/OpenFOAM-1.6/wmake yes
yes yes
-----------------------------------------------------------------------------Checking the OpenFOAM env variables set on the LD_LIBRARY_PATH...
-----------------------------------------------------------------------------Environment_variable Set_to_file_or_directory
Valid
Path Crit
-----------------------------------------------------------------------------$FOAM_LIBBIN
...OAM/OpenFOAM-1.6/lib/linux64GccDPOpt yes
yes yes
$FOAM_SITE_LIBBIN
...penFOAM/site/1.6/lib/linux64GccDPOpt no
no
$FOAM_USER_LIBBIN
...OAM/nicholas-1.6/lib/linux64GccDPOpt no
no
$MPI_ARCH_PATH
...nmpi-1.3.3/platforms/linux64GccDPOpt yes
yes yes
-----------------------------------------------------------------------------Third party software
-----------------------------------------------------------------------------Software Version
Location
-----------------------------------------------------------------------------gcc
4.3.3
...OAM/ThirdParty-1.6/gcc4.3.3/platforms/linux64/bin/gcc
gzip
1.3.12
/usr/bin/gzip
tar
1.20
/bin/tar
icoFoam 1.6
.../OpenFOAM1.6/applications/bin/linux64GccDPOpt/icoFoam
-----------------------------------------------------------------------------Summary
-----------------------------------------------------------------------------Base configuration ok.
Critical systems ok.
done.
The important part are the last lines which state the basic configuration and critical
systems are both good. If these two lines do not say OK, you need to look through the
details of the test results to see what went wrong.
If these two lines do say OK, congratulations! You have successfully installed
OpenFOAM. The last step is to setup the files for using OpenFOAM and run a simple
test case.
Copy the tutorial examples directory in the OpenFOAM distribution to the run
directory. If the OpenFOAM environment variables are set correctly, then the
following command will be correct:
cp -r $WM_PROJECT_DIR/tutorials $FOAM_RUN
Run the first example case of incompressible laminar flow in a cavity. Type the
following into the command line:
>cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
>blockMesh
>icoFoam
>paraFoam