Post-Processing Guide

OpenFOAM Post-Processing with ParaView: Complete Guide

ParaView is the standard visualisation tool for OpenFOAM results. Getting from a finished simulation to useful plots and images requires knowing how to load cases correctly, reconstruct parallel data, and apply the right filters. This guide covers the full workflow from loading your case to extracting forces and plotting residuals.

By CFDpilot · Updated April 2026

1. Loading an OpenFOAM case in ParaView

ParaView reads OpenFOAM cases natively through the OpenFOAMReader. To load your case:

  1. In your case directory, create an empty .foam file: touch myCase.foam
  2. Open ParaView, go to File → Open, and select myCase.foam
  3. The OpenFOAMReader plugin loads automatically. Click Apply.
  4. Select which fields to load in the Properties panel (U, p, k, etc.)

Alternatively, use the command:

# Launch ParaView directly on the case (from the case directory)
paraFoam

paraFoam creates the .foam file automatically and opens ParaView. On newer OpenFOAM versions, it launches ParaView with the OpenFOAMReader pre-configured.

When loading a case in ParaView, the Properties panel shows checkboxes for each field (U, p, k, epsilon, etc.) and for each patch (boundary surfaces). To improve performance on large cases, deselect fields you do not need before clicking Apply. ParaView reads all time steps by default — use the Time Manager (View → Time Manager) to limit which time steps are loaded into memory.

If ParaView shows no data after clicking Apply, check that the .foam file is in the case root directory (the one containing constant/, system/, and time directories). The OpenFOAMReader also requires at least one time directory other than 0/ to display field data.

2. Reconstructing parallel cases

If your simulation ran in parallel (using mpirun), the results are split across processor0/, processor1/, ... directories. ParaView cannot read these directly — you need to reconstruct first.

# Reconstruct all time steps
reconstructPar

# Reconstruct a specific time range
reconstructPar -time '100:200'

# Reconstruct the latest time only
reconstructPar -latestTime

After reconstruction, the merged field data appears in the standard time directories (100/, 200/, etc.) and can be loaded normally in ParaView.

Alternatively, ParaView can read decomposed cases directly using the Decomposed Case option in OpenFOAMReader (check "Case Type: Decomposed Case"). This skips reconstruction but is slower for large cases.

When reconstructing large cases (hundreds of time steps), reconstruction can be slow. Speed it up by reconstructing only specific fields and time ranges. For ongoing monitoring during a running simulation, use -latestTime to reconstruct just the current result:

# Reconstruct only velocity and pressure at the latest time
reconstructPar -latestTime -fields '(U p)'

3. Converting to VTK with foamToVTK

For workflows that require VTK files (e.g. batch processing, use with other tools), use foamToVTK:

# Convert all fields at all times to VTK
foamToVTK

# Convert specific fields only
foamToVTK -fields '(U p k)'

# Convert a specific time step
foamToVTK -time 500

Output goes to a VTK/ directory. Open the .vtm or .vtu files in ParaView using the standard VTK reader. VTK format is useful when sharing results with collaborators who do not have the OpenFOAM reader installed.

4. Key ParaView filters for CFD results

Slice filter

Use Filters → Slice to cut a plane through the domain. Set the origin and normal to define the cutting plane. Useful for viewing contour plots of velocity, pressure, or temperature on mid-planes. Apply "Color by" to the field of interest and adjust the colour range.

Streamline filter (Stream Tracer)

Use Filters → Stream Tracer to visualise flow paths. Set the input to your U field. Choose seed type (Point Cloud, Line, etc.) and position seeds in the inlet or region of interest. For 3D cases, use Tube filter on top of Stream Tracer to make lines visible.

Calculator filter for derived quantities

ParaView's Calculator filter computes derived quantities from existing fields:

// Magnitude of velocity (if U is a vector field named "U")
mag(U)

// Dynamic pressure (requires p in m2/s2 and known density)
// For incompressible (rho = 1000 kg/m3 for water):
0.5 * 1000 * mag(U) * mag(U)

// Vorticity component
// Use Gradient Of Unstructured Data Filter then Calculator

For wall shear stress and y+ values, use the OpenFOAM wallShearStress and yPlus function objects to compute these before loading in ParaView, rather than computing them in ParaView.

Use the Threshold filter to isolate regions by field value (e.g. show only cells where vorticity exceeds a threshold, or where temperature is above 500 K). The Clip filter cuts the domain along a plane or sphere. The Iso Surface filter (Contour) draws iso-surfaces of scalar fields such as Q-criterion for vortex identification or pressure coefficient for aerodynamics.

// Compute Q-criterion in OpenFOAM before loading in ParaView
simpleFoam -postProcess -func Q

The Q-criterion is defined as Q = 0.5 * (|Omega|² - |S|²), where Omega is the vorticity tensor and S is the strain rate tensor. Positive Q identifies vortex cores. OpenFOAM computes it as a post-processing function object, writing Q to the time directories. In ParaView, apply a Contour filter on Q with iso-value 0 or a positive threshold to visualise vortical structures.

5. Plotting residuals from the solver log

OpenFOAM residuals are written to the solver log (stdout). To plot them, use the foamLog utility to extract residuals into CSV-compatible files:

# Extract residuals from log file into logs/ directory
foamLog log.simpleFoam

This creates files like logs/p_0, logs/Ux_0 etc. Load these into ParaView with SpreadSheet View or plot with Python/gnuplot. Alternatively, use the sample or probe function objects to monitor field values at points during the run:

// system/controlDict — add to functions block
functions
{
    probePoint
    {
        type            probes;
        libs            (sampling);
        writeControl    timeStep;
        writeInterval   1;
        fields          (p U);
        probeLocations
        (
            (0.5 0 0)
            (1.0 0 0)
        );
    }
}

6. Extracting forces with forceCoeffs function object

For aerodynamic post-processing, the forceCoeffs function object computes lift, drag, and moment coefficients during the run. Configure it in system/controlDict:

functions
{
    forceCoeffs
    {
        type            forceCoeffs;
        libs            (forces);
        writeControl    timeStep;
        writeInterval   1;
        patches         (wing);
        rho             rhoInf;
        rhoInf          1.225;   // kg/m3, for incompressible
        liftDir         (0 1 0);
        dragDir         (1 0 0);
        CofR            (0.25 0 0);  // centre of rotation
        pitchAxis       (0 0 1);
        magUInf         30;
        lRef            1;    // reference length
        Aref            1;    // reference area
    }
}

Results are written to postProcessing/forceCoeffs/0/coefficient.dat. Load this in ParaView with the CSV reader or plot directly with Python's matplotlib or pandas.

7. Sampling line profiles and surface data

The OpenFOAM sample function object extracts field values along lines, at points, or on surfaces during or after the run. This is more accurate than ParaView interpolation because it uses the actual cell-centre data:

// system/controlDict — sample function object
functions
{
    lineProfile
    {
        type            sets;
        libs            (sampling);
        writeControl    writeTime;
        fields          (U p k);
        interpolationScheme cellPoint;
        setFormat       raw;
        sets
        (
            centreLine
            {
                type    uniform;
                axis    x;
                start   (0 0.5 0.05);
                end     (5 0.5 0.05);
                nPoints 200;
            }
        );
    }
}

Run the sampling after the simulation completes with:

# Extract line profiles at all written time steps
simpleFoam -postProcess -func lineProfile

Output goes to postProcessing/lineProfile/. The raw format produces space-separated text files readable directly by Python, gnuplot, or MATLAB. For surface sampling (e.g. pressure on a wall patch), use type surfaces instead of type sets and specify the patch name.

8. Wall shear stress and y+ extraction

Wall shear stress and y+ cannot be accurately computed inside ParaView from cell-centre data alone. Use the dedicated OpenFOAM function objects instead:

# Compute y+ at the latest time step after a completed run
simpleFoam -postProcess -func yPlus -latestTime

# Compute wall shear stress
simpleFoam -postProcess -func wallShearStress -latestTime

Both commands write the fields to the latest time directory. Load them in ParaView the same way as any other field — they appear as yPlus and wallShearStress in the field list after clicking Apply on the OpenFOAMReader. Colour the wall patches by yPlus to verify wall resolution: for wall-resolved LES, y+ should be below 1; for wall functions (RANS), y+ should be 30–300.

Get your simulation results analysed automatically — free

Upload your case and solver log and CFDpilot identifies convergence issues and anomalies in your field data.

Analyse my results →
Official documentation

Frequently Asked Questions

How do I open an OpenFOAM case in ParaView?

Create an empty .foam file in the case directory (touch myCase.foam), then open it with File → Open in ParaView. The OpenFOAMReader plugin loads automatically. Click Apply to import the fields. Alternatively, run paraFoam from the case directory to launch ParaView with the case pre-configured.

Do I need to run reconstructPar before opening a parallel case in ParaView?

No. Set Case Type to "Decomposed Case" in the OpenFOAMReader Properties panel to read processor directories directly. However, this is slower for large cases. For most workflows, running reconstructPar first and loading the merged time directories is faster and more convenient.

How do I plot residuals from an OpenFOAM simulation?

Run foamLog log.simpleFoam to extract residuals into a logs/ directory (files like logs/p_0, logs/Ux_0). Load these in ParaView with the SpreadSheet View or plot with Python. Alternatively, add the solverInfo function object to system/controlDict to write residuals to postProcessing/solverInfo/ during the run.

How do I visualise velocity streamlines in ParaView?

Apply Filters → Stream Tracer with U as the input. Choose Point Cloud or Line as the seed type and position seeds at the inlet or region of interest. Apply a Tube filter on top of Stream Tracer to give streamlines visible thickness. Set integration direction to FORWARD for downstream tracing.

How do I extract drag and lift coefficients from OpenFOAM results?

Add the forceCoeffs function object to system/controlDict with the correct patches, liftDir, dragDir, magUInf, lRef, and Aref. The solver writes to postProcessing/forceCoeffs/0/coefficient.dat. Load this CSV file in ParaView with the CSV reader or plot with Python using pandas.read_csv().

How do I compute y+ from OpenFOAM results?

Do not compute y+ in ParaView — it requires boundary condition information not available to ParaView's interpolation. Use the OpenFOAM yPlus function object instead: simpleFoam -postProcess -func yPlus -latestTime. This writes a yPlus field to the time directory that you can then load and colour in ParaView. For RANS wall functions, target y+ between 30 and 300.