Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
openfoam
openfoam
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 331
    • Issues 331
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 6
    • Merge Requests 6
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Development
  • openfoamopenfoam
  • Wiki
  • running

Last edited by Kutalmis Bercin Aug 04, 2020
Page history

running

home

Once OpenFOAM has been built and installed, running it requires a properly defined environment prior to executing any applications or solvers. For a runtime environment, the absolute minimum is the following:

Enviroment Use
WM_PROJECT_DIR The installation location of OpenFOAM
PATH Must include platforms-specific OpenFOAM bin directory
LD_LIBRARY_PATH Must include platforms-specific OpenFOAM lib directory, and MPI library variants

There are various ways to setup a minimum or fuller environment. Which one you choose is largely personal preference and depends on how much flexibility or permanence is desired.

  • Transient (one-time) use
    • Manually
    • Shell session
  • Persistent selection
    • Manual
    • Configured via openfoam-selector

Transient (one-time) use

In many cases it is desirable to activate a particular OpenFOAM version, do something with it and possibly restore to the previous state without exiting the shell.

Manually

To manually activate a particular OpenFOAM version, source its corresponding etc/bashrc file:

$ . /path/to/openfoam/etc/bashrc

After using the desired OpenFOAM commands, the wmUnset alias can be used to remove it again.

NOTE: The /path/to/openfoam location will depend on the OpenFOAM version and installation.

bash Shell session

Depending on your packaging system (or system administrator), an OpenFOAM shell session command may be available as a convenient means of defining and using an OpenFOAM environment.

The shell session can be particularly useful when running a single OpenFOAM application from within a workflow.

Persistent selection

Manual

For a persistent OpenFOAM environment, the OpenFOAM bashrc file can be sourced from your ~/.bashrc file by adding a line resembling the following to that file:

. /path/to/openfoam/etc/bashrc

It is usually prudent to check the existence of the file prior to sourcing it:

if [ -f  /path/to/openfoam/etc/bashrc ]
then  . /path/to/openfoam/etc/bashrc
fi

NOTE: The /path/to/openfoam location will depend on the OpenFOAM version and installation.

Configured via openfoam-selector

Depending on your packaging system (or system administrator), an openfoam-selector may be available to define the preferred OpenFOAM version for the login shell.


Copyright (C) 2019-2020 OpenCFD Ltd.

Clone repository
  • Repository migration
  • Submitting issues
  • building
  • building
    • cross compile mingw
  • coding
    • git workflow
    • patterns
      • HashTable
      • dictionary
      • memory
      • patterns
      • precision
      • selectors
      • strings
    • style
      • style
  • Home
  • icons
    • info
View All Pages