Getting Started
First Step in OpenFoam :
Once you have installed OpenFOAM, hopefully without losing your mind, you can start its environment by typing in the terminal
openfoamXXXX
where XXXX is the version selected during the download.
From now on, the journey begins.
Your First Case:
To run your first simulation, it is essential to understand how the software operates. Each simulation is organized into several sub-folders:
- "Simulation_1"
- "0"
- "constant"
- "system"
The 0 directory contains specifications for the boundary fields, including patch type and initial values.
The constant directory houses the geometry, mesh and files that define constant values, such as fluid or turbulence properties.
The system directory hold all the instruction needed, including the Solver, numeric schemes, number of iterations, multi-processing options, and more.
This is a brief overview of how a general case is structured in OpenFOAM. Below an illustration of how the directory should look. To clarify the upcoming paragraphs, we will use a tutorial located in the OpenFOAM sub-directory. You can access it by typing the following commands in your terminal :
cd $FOAM_TUTORIALS
cd incompressible/simpleFoam/motorBike/
0 directory:
The 0 directory contain the following files :
- "0.orig"
- U
- p
- nut
- k
- omega
There is also another directory "include", but for now ignore it. The image on the left show how the file is structured.

In particular the image is referred to the U file, but all of them have the same structure. The file is like a key-value dictionary where the first key encountered is dimension, following internalField and boundaryField (we skipped the "#include" for now) . The dimension, as we can imagine, define the physical dimensional unit of the field. The array [ ... ] has 7 slots that represent 7 different units in this order:
| No. | Property | SI unit | USCS unit |
| 1 | Mass | kilogram (kg) | pound-mass (lbm) |
| 2 | Length | metre (m) | foot (ft) |
| 3 | Time | second (s) | second (s) |
| 4 | Temperature | Kelvin (K) | degree Rankine (R) |
| 5 | Quantity | mole (mol) | mole (mol) |
| 6 | Current | ampere (A) | ampere (A) |
| 7 | Luminous intensity | candela (cd) | candela (cd) |
The number given to the array represent the order of the dimension, for example is [0 1 -1 0 0 0 0].
Internal field key represent the value of the field at the beginning.
The boundary field key contains all the boundary conditions defined in the mesh. Each of them need a type and the relative options. Here is linked the standard boundary conditions list for OpenFOAM.