OpenFOAM Fundamentals in 2026 - Case Structure & Commands (Guide)
OpenFOAM Fundamentals in 2026
The essentials every beginner needs: what OpenFOAM is, how a case is structured, the input files, the command line, and how to track and fix simulation issues.
OpenFOAM is the most powerful free CFD toolbox in the world — and in 2026 it's more capable than ever. But because it's driven by text files and the command line rather than a single graphical button, beginners often feel lost at the start. This guide fixes that. We'll walk through the five OpenFOAM fundamentals you must master — what it is, the case structure, the input types, the command line, and tracking issues — so you can open any case and understand exactly what you're looking at.
What This Guide Covers
1. About OpenFOAM
OpenFOAM (Open-source Field Operation And Manipulation) is a free CFD toolbox for simulating fluid flow, heat transfer, turbulence, multiphase flows and much more. Unlike commercial packages, it isn't one program with a big GUI — it's a collection of solver and utility applications that run on text-based case files.
The trade-off is the learning curve — which is exactly what these fundamentals remove.
2. Case Structure — The Three Folders
This is the single most important thing to learn. Every OpenFOAM case has the same three directories:
Initial & Boundary Conditions
One file per field (p, U, k, epsilon…) setting its starting values and boundary conditions.
Mesh & Physical Properties
The mesh (in polyMesh/) plus properties like transportProperties and turbulenceProperties.
Run Control & Numerics
controlDict (time & output), fvSchemes (discretization), fvSolution (linear solvers), blockMeshDict.
Here's what a real case looks like — the classic pitzDaily tutorial:
$ ls -p # the case root 0/ constant/ system/ $ ls -p 0/ # field files (initial + BCs) epsilon k p U $ ls -p constant/ # mesh + properties polyMesh/ transportProperties turbulenceProperties $ ls -p system/ # control + numerics blockMeshDict controlDict fvSchemes fvSolution
| Folder | Holds | Key files |
|---|---|---|
0/ | Initial & boundary conditions | p, U, k, epsilon, T… |
constant/ | Mesh & physical properties | polyMesh/, transportProperties, turbulenceProperties |
system/ | Solver control & numerics | controlDict, fvSchemes, fvSolution, blockMeshDict |
3. Input Types — Dictionary Files
Every OpenFOAM setting lives in a plain-text dictionary file. The format is simple: a keyword followed by its value, with related settings grouped into named sub-dictionaries. Here's a snippet from a controlDict:
application simpleFoam; // which solver startTime 0; endTime 1000; deltaT 1; writeInterval 100; // save every 100 steps // a sub-dictionary example (fvSolution) solvers { p { solver GAMG; tolerance 1e-06; relTol 0.1; } }
Because they're just text:
- You can edit them in any text editor.
- You can version-control them with Git.
- You can script and template them for parametric studies.
Each dictionary has its own required and optional keywords, and which files you need depends on the solver and physics. Fluid properties go in transportProperties — grab correct values from a Reynolds number check, and set inlet turbulence with the turbulence intensity calculator.
4. The Command Line
OpenFOAM applications are run by typing their name in the case directory. No GUI required — and this is what makes it so automatable.
$ blockMesh # build the mesh from blockMeshDict $ checkMesh # validate the mesh $ simpleFoam # run the solver # useful options & patterns $ simpleFoam -case ../myCase # run a different case dir $ simpleFoam > log.simpleFoam 2>&1 & # log + run in background $ decomposePar && mpirun -np 4 simpleFoam -parallel # parallel run
Handy essentials:
- Tab completion: press
<TAB>after a command to list its options. -case <dir>: run on a case other than the current folder.-parallel: run across cores (afterdecomposePar) — free, no core limit.- Redirect to a log:
> log.solver 2>&1keeps the output for monitoring. - Background run: add
&so long jobs don't block the terminal.
5. Tracking Issues
OpenFOAM tells you everything through its log output — you just need to know what to read.
Check the mesh first
Before solving, always run checkMesh. The line you want is:
$ checkMesh ... Mesh OK. # the mesh passed all checks
Watch non-orthogonality and skewness — high values cause most divergence. Confirm the mesh is fine enough with a grid-independence test.
Watch the residuals
The solver writes residuals every iteration to the log. Falling residuals that level off = converging; rising residuals or a floating-point error = a problem.
Time = 100 smoothSolver: Solving for Ux, Initial residual = 1e-03, Final residual = 1e-06 GAMG: Solving for p, Initial residual = 5e-03, Final residual = 8e-07 ...
Tools like foamLog and foamMonitor can plot residuals live. Keep the Courant number sane in transient runs — estimate it with the CFL / Courant number calculator.
checkMesh, verify boundary/initial conditions, reduce the time step or under-relaxation, and change one thing at a time. It's almost always the mesh or a boundary condition — not the solver. Check near-wall spacing with the y+ calculator.The Basic OpenFOAM Workflow
- Copy a tutorial case close to your problem (never start blank).
- Edit the dictionaries in
0/,constant/,system/. - Mesh:
blockMesh(or import), thencheckMesh→ Mesh OK. - Run: the solver, redirecting to a log.
- Track: watch residuals; judge convergence.
- Post-process: view results in ParaView (
paraFoam).
Build geometry for real cases with open-source CAD tools, then mesh and solve.
Where to Go Next
With the fundamentals down, deepen your skills:
- Run several tutorial cases and read every dictionary line by line.
- Learn
snappyHexMeshfor real, complex geometry. - Study turbulence models (k-ε, k-ω SST) and wall functions.
- Automate with
Allrunscripts and version-control your cases.
Frequently Asked Questions
What is OpenFOAM?
A free, open-source CFD toolbox — a collection of solver and utility apps that run on text case files to simulate fluid flow, heat transfer and turbulence, with no core-count licence limit.
What are the three folders in an OpenFOAM case?
0/ (initial & boundary conditions), constant/ (mesh + physical properties), and system/ (controlDict, fvSchemes, fvSolution). Learn these and any case makes sense.
What kind of input files does OpenFOAM use?
Plain-text dictionaries in a keyword-value format, grouped into sub-dictionaries. Editable in any text editor and version-controllable with Git.
How do I run an OpenFOAM command?
Type the solver/utility name in the case directory (e.g. blockMesh, simpleFoam). Add options like -case or -parallel; press TAB to list options; redirect to a log to monitor.
How do I check an OpenFOAM mesh?
Run checkMesh and look for Mesh OK. Watch non-orthogonality and skewness — poor mesh quality causes most divergence.
How do I track and fix problems in an OpenFOAM simulation?
Read the log's residuals for convergence; on failure, read the error, re-check mesh and BCs, lower the time step/relaxation, and change one thing at a time. Usually it's the mesh or a BC.
Conclusion
OpenFOAM's power comes from its text-and-command-line design — and once you know the five fundamentals, that design becomes a superpower rather than a barrier. Remember the three folders (0/, constant/, system/), the dictionary input format, the command-line basics, and how to track mesh quality and residuals. Copy a tutorial, read it folder by folder, run it, watch the log — and you're doing real CFD in OpenFOAM. In 2026, with WSL2, GUIs and a huge community, there's never been an easier time to start.
For more OpenFOAM, CFD and simulation tutorials plus free engineering calculators, explore Free CFD Tutorial. If this guide helped you, please share it with your fellow CFD engineers and students.

Comments
Post a Comment