OpenFOAM

According to Wikipedia:

OpenFOAM (for "Open source Field Operation And Manipulation") is a C++ toolbox for the development of customized numerical solvers, and pre-/post-processing utilities for the solution of continuum mechanics problems, including computational fluid dynamics (CFD).

Basic installation

If you do not plan on doing development tasks with OpenFOAM, there is an updated version of the program available in the AUR package openfoam-orgAUR and git versions openfoam2.4-gitAUR or openfoam3.0-gitAUR. For most users, this will be everything needed to get an installation up and running.

Development installation

For installation of OpenFOAM in a development environment, the process is fairly straight forward on Arch Linux. The basic steps are as follows:

  1. Obtain source files from OpenFOAM
  2. Prepare build directory
  3. Create Preference File and Set Environment Variables for your installation
  4. Compile OpenFOAM sources
  5. Test OpenFOAM installation

Prerequisites

Environment variables

Paste the following code into your ~/.bashrc file. Whenever you want to run OpenFOAM you just have to type of20x to initialize the environment.

# OpenFOAM Install
export FOAM_INST_DIR='$HOME/.OpenFOAM'
alias of20x='source $FOAM_INST_DIR/OpenFOAM-2.0.x/etc/bashrc'

Troubleshooting

zsh

Some things do not work straightforward if you are not using bash. In the case of zsh, you will need the package, and add the following to your for the OpenFOAM scripts to work.

Add and export BASH=/bin/bash to your and to your .

Paraview not installed

This happens because the dependencies are installed as separate packages, and not in the third-party apps directory of OpenFOAM. Either;

  • Add to your /opt/OpenFOAM/Open-FOAM-X.X/etc/bashrc.
  • For each project, and then open the touched file from paraview.

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.