Getting started

1.1 Getting started

An OpenFOAM case requires definitions for the mesh, initial fields, physical models, control parameters, etc. As described in the User Guide section ??, OpenFOAM data is stored in a set of files within a case directory rather than in a single case file. The case directory is given a suitably descriptive name, e.g. the first example case for this tutorial guide is simply named cavity, under which the required information is located in the three directories:

  • constant
  • system, and
  • initial time directory, e.g.0.

Editing files is possible in OpenFOAM because the I/O uses a plain text dictionary format with keywords that convey sufficient meaning to be understood by even the least experienced users. Many editors are available for both Linux and Windows environments, e.g. on Ubuntu the default GUI-based editor is gedit, and default terminal editor is nano. Other popular text editors include vim, emacs, kate, and atom.

1.1.1 Note for Windows Users

When using a shared directory, e.g. between Windows and Docker, users may prefer to use a Windows-based text editor. However, care should be taken not to change the encoding of the text files to ensure that they remain readable by OpenFOAM. Good choices may be atom and PSPad — both are free and automatically keep the correct encoding.