The global controlDict file can be found in the installation within a directory named etc, represented by the environment variable $FOAM_ETC. The file contains sub-dictionaries for the following items.
- Documentation: for opening documentation in a web browser.
- InfoSwitches: controls information printed to standard output, i.e. the terminal.
- OptimisationSwitches: for parallel communication and I/O, see section 3.4.2.
- DebugSwitches: messaging switches to help debug code failures, as described in section 3.2.6.
- DimensionedConstants: defines fundamental physical constants, e.g. Boltzmann’s Constant.
- DimensionSets: defines a notation for dimensional units, e.g. kg.
While a user could modify this setting in the etc/controlDict file in the installation, it is better practice to use a file in their user directory. OpenFOAM provides a set of directory locations, where global configuration files can be included, which it looks up in an order of precedence. To list the locations, simply run the following command.
If a user therefore wished to work permanently in USCS units, they could maintain a controlDict file in their $HOME/.OpenFOAM directory that includes the following entry.
OpenFOAM would read the unitSet entry from this file, but read all other controlDict keyword entries from the global controlDict file.
Alternatively, if a user wished to work on a single case in USCS units, they could add the same entry into the controlDict file in the system directory for their case. This file is discussed in the next section.
© 2011-2020 OpenFOAM Foundation