OpenFOAM Post-Processing

Category: Open-Source CAE | Revised 2026-10-02
CAE visualization for openfoam postprocess theory - technical simulation diagram
OpenFOAM Post-Processing

Theory: how numbers are extracted

Overview

🙋

Isn't OpenFOAM post-processing just looking at results in ParaView?

🎓

For viewing, ParaView is enough, but numbers for design are normally extracted with function objects. Listing forces (forces and moments), forceCoeffs (drag and lift coefficients), probes (point time histories), sets and surfaces (distributions on lines and planes), fieldAverage (time averages), yPlus and wallShearStress under functions in system/controlDict writes them to the postProcessing folder during the run. postProcess -func applies the same operations to existing results afterwards. Common mistakes are in reference area, speed and density, the start time of averaging and output intervals — each can change the magnitude or meaning of results.

Coefficient definitions and units

$$ C_d = \frac{F_d}{\tfrac12 \rho_\infty U_\infty^2 A_{\text{ref}}},\qquad A_{\text{ref}} = D \times \text{(mesh thickness)},\qquad St = \frac{f D}{U_\infty},\qquad p_{\text{Pa}} = \rho\, p_{\text{kin}} $$

F_d is drag, ρ∞ and U∞ reference density and speed, A_ref the reference area, D cylinder diameter, f shedding frequency, St the Strouhal number and p_kin the kinematic pressure of incompressible solvers.

Coffee Break Trivia

paraFoam and ParaView

paraFoam, which opens OpenFOAM results, is really a script that launches ParaView with a reader for the OpenFOAM format. ParaView itself is visualisation software developed by US national laboratories and Kitware, separate from OpenFOAM. ParaView's built-in reader (a .foam file) opens cases without paraFoam, which is common when viewing cluster results on a Windows PC.

Worked examples

Cd = 1.33 and St = 0.165 are illustrative inputs for setup arithmetic, not simulation results from this site. A benchmark comparison must match blockage and boundary conditions. Use release-appropriate commands, such as foamPostProcess in Foundation v13.

Example: cylinder at Re = 100 (D 0.01 m, U 1 m/s, ν 1×10⁻⁴ m²/s, mesh thickness 0.002 m)

ItemValueNote
Drag coefficient (literature)≈ 1.33Time-averaged
Strouhal number (literature)≈ 0.165
Drag over the mesh thickness1.33×10⁻⁵ NrhoInf = 1
Reported with Aref = D (wrong)0.00266500 times too small
Shedding frequency / period16.5 Hz / 0.061 s
Sampling for 20 points per period0.003 s
Time for a 10-period average0.61 sAfter the initial transient

Literature values are representative. The forceCoeffs reference area is diameter × mesh thickness; the shedding frequency comes from an FFT of the lift coefficient history.

🙋

Averaging my drag coefficient history gave 1.45, 9% above the literature 1.33. Should I refine the mesh?

🎓

First check how you averaged. Vortex shedding behind the cylinder grows for a while after start-up and may take tens of periods to become periodic; averaging from the start mixes in the transient. Start fieldAverage or forceCoeffs averaging once the lift coefficient amplitude is steady, and average over a whole number of periods (say 10, which is 0.61 s here); cutting mid-period biases the mean by the oscillation. If a gap remains, check in turn the domain size (nearby side walls raise drag; aim for a width at least 20 diameters), outlet position, time step (Courant number) and then the mesh.

Practical workflow

  1. Decide the numbers you need (forces, coefficients, point histories, section profiles) and write them as function objects in controlDict.
  2. Set reference area, length, speed and density — including mesh thickness for 2D.
  3. For unsteady flow, write at under 1/20 of the period and average over whole periods after the transient.
  4. Check wall treatment with yPlus and wallShearStress.
  5. Compare with literature or experiments, investigating differences via domain, time step and mesh in turn.
Coffee Break Trivia

“Parallel results can't be opened as is”

Results from a decomposePar parallel run are stored split into processor0, processor1 and so on. Opening the case directly in ParaView may show only the first time, which confuses people. Join them with reconstructPar, or choose 'Decomposed Case' when opening the .foam file. Function object output is written once into the postProcessing folder, so extracting numbers there is more reliable.

Common mistakes

Mistakes and fixes

MistakeEffectFix
Omitting thickness from Aref in 2DCoefficients off by orders of magnitudeDiameter × mesh thickness
Reading kinematic pressure as PaPressure and force off by densitySpecify rhoInf
Averaging including the transientBiased meanWhole periods after periodicity
Coarse output intervalWrong frequencyUnder 1/20 of the period
Wrong force direction vectorsLift and drag swappedCheck liftDir and dragDir
🙋

I'd like to learn related topics.

Frequently asked questions

How do I get forces and coefficients in OpenFOAM?

Add forces or forceCoeffs to the functions (function objects) in system/controlDict so they are written during the run. forceCoeffs needs reference speed magUInf, reference length lRef, reference area Aref, fluid density rhoInf and force directions (liftDir, dragDir). They can also be computed afterwards from saved results with postProcess -func.

My 2D drag coefficient is absurdly small.

Most likely the reference area Aref omits the mesh thickness. A 2D OpenFOAM case is a one-cell-thick 3D mesh, so forces act only over that thickness. For a 0.01 m cylinder on a 0.002 m thick mesh, Aref = 0.01 × 0.002 m². Entering Aref = 0.01 reports a drag coefficient of 0.00266 instead of 1.33.

The pressure values from an incompressible solver look wrong.

Incompressible solvers such as simpleFoam and pimpleFoam solve kinematic pressure — pressure divided by density, in m²/s². For air (1.2 kg/m³), p = 50 m²/s² corresponds to 60 Pa. In forces, unless you give rho rhoInf and a value for rhoInf, forces are computed with density 1.

References and scope of verification

Numbers are educational reference calculations under the stated assumptions. Sources document theory and setup, not proof that these numerical values were reproduced in each package. Engineering decisions require validation for the actual conditions.

Related Simulators

Experience the theory firsthand with the interactive simulator for this field

All Simulators

Related fields

Structural AnalysisFluid Analysis (CFD)Thermal Analysis
Rate this article
Thank you for your feedback!
Helpful
More details
Report error
Helpful
0
More details
0
Report error
0