[version 10][version 9][version 8][version 7][version 6]
4.3 Global controls
OpenFOAM includes a large number of global parameters that are conﬁgured by default in a ﬁle named controlDict. This is the so-called “global” controlDict ﬁle, as opposed to a case controlDict ﬁle that is described in the following section.
The global controlDict ﬁle can be found in the installation within a directory named etc, represented by the environment variable $FOAM_ETC. The ﬁle 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: deﬁnes fundamental physical constants, e.g. Boltzmann’s Constant.
- DimensionSets: deﬁnes a notation for dimensional units, e.g. kg.
4.3.1 Overriding global controls
The values of the DimensionedConstants depend on the unit system being adopted, i.e. the International System of Units (SI units), or US Customary system (USCS), based on English units (pounds, feet, etc.). The default system is naturally SI, but some users may wish to override this with USCS units, either globally or for a speciﬁc case. The system is set through the unitSet keyword, i.e.
While a user could modify this setting in the etc/controlDict ﬁle in the installation, it is better practice to use a ﬁle in their user directory. OpenFOAM provides a set of directory locations, where global conﬁguration ﬁles 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 ﬁle in their $HOME/.OpenFOAM directory that includes the following entry.
OpenFOAM would read the unitSet entry from this ﬁle, but read all other controlDict keyword entries from the global controlDict ﬁle.
Alternatively, if a user wished to work on a single case in USCS units, they could add the same entry into the controlDict ﬁle in the system directory for their case. This ﬁle is discussed in the next section.