Home / Insights

CFD series · Part 2 of 6

How to Read a CFD Result: Contours, Vectors and Streamlines

Contents
  1. The case: flow over a backward-facing step
  2. One result, four views
  3. Contours: where it is fast, not which way
  4. Vectors: direction, at the cost of clutter
  5. Streamlines: paths, if the seeds are right
  6. Line plots: the exact numbers, on one line only
  7. What each view shows and hides
  8. What to ask a CFD supplier for
  9. A checklist for reading a CFD report
  10. Common mistakes
  11. Key points
  12. References

A CFD report arrives as a set of colourful pictures. They look like a photograph of the flow, but they are not. Every picture is drawn by choices: which quantity to colour, where the colour scale starts and stops, where the arrows go and where the streamlines begin. The same result can look calm or alarming, smooth or full of eddies, depending on those choices.

This is Part 2 of the CFD series. Part 1 covered what CFD is and when it is worth paying for. Here we take one solved result and draw it four ways: contours, vectors, streamlines and line plots. For each we look at what it shows, what it hides and how it can mislead, then end with what to ask a CFD supplier for and a checklist for reading a CFD report.

The case: flow over a backward-facing step

A channel suddenly doubles in height. Liquid leaves the narrow part as a jet, cannot turn the sharp corner, and leaves a bubble of slowly turning liquid behind the step. The same thing happens wherever a flow meets a sudden expansion: a pipe enlarger, a nozzle entering a vessel, a distributor or a settler inlet. Those bubbles are dead zones. Solids settle in them, heat transfer is poor and liquid stays much longer than the average residence time. Finding them is one of the most common reasons to run CFD in a process plant.

We use this case because it is a published benchmark with known answers, so we can check the solution before we read it. The conditions are those of Gartling (1990): a downstream channel of height H, a step of height H/2, a parabolic inlet profile over the upper half and a Reynolds number of 800:

\[\mathrm{Re} = \frac{U\,H}{\nu} = 800\]

where \(U\) is the mean inlet velocity and \(\nu\) the kinematic viscosity of the liquid. In everyday units that is, for example, water at 20 °C in a Vancouver plant entering through a slot 10 mm high at a mean 4.0 cm/s, into a channel 20 mm high. The flow is laminar and steady. Lengths below are given in channel heights H and speeds as multiples of U, so the results hold for any liquid and size at this Reynolds number.

Inlet: parabolic profile, mean speed UH/2HMain bubble: flows back, reattaches at x = 6.09 HUpper-wall bubble: x = 4.77 to 10.51 HOutlet at x = 30 H024681012x / HSolved: liquid flowing back (u < 0)
Inlet: parabolic, mean speed UH/2HMain bubble reattaches at x = 6.09 HUpper bubble: 4.77 to 10.51 H0246810x / HSolved backflow (u < 0)
Figure 1. The test case. Liquid enters along the upper half of the channel and the channel doubles in height at x = 0. The shaded regions come from the solved result and show where the liquid flows backwards. Heights are drawn about three times larger than lengths so the thin regions can be seen. The domain runs to x = 30 H.

We solved it in OpenFOAM v1912 with the steady incompressible solver simpleFoam, laminar, with second-order upwind convection, on a uniform mesh of 1,200 by 80 cells (96,000 cells, each 0.025 H long and 0.0125 H high). The solver stopped when the velocity residuals fell below 1 × 10−8; the pressure residual was then about 1 × 10−8 as well. Table 1 also gives a mesh with a quarter of the cells. The separation and reattachment points are read where the wall shear stress, from a second-order velocity gradient at the wall, changes sign (see Figure 3). Both meshes agree with the benchmark: the coarser to within about 7% and the finer to within 2%. How the points are read matters on the thin upper bubble: taking the sign of the velocity in the cells next to the wall, a common shortcut, moves them by up to 0.07 H on the finer mesh. That check comes first: a beautiful picture of a wrong answer is still wrong. Part 3 covers the mesh and Part 5 checking CFD against hand calculations.

ResultMesh of 24,000 cellsMesh of 96,000 cellsBenchmark (Gartling 1990)
Main bubble reattaches on the lower wall5.93 H (−2.7%)6.09 H (−0.1%)6.10 H
Upper-wall bubble starts4.54 H (−6.3%)4.77 H (−1.6%)4.85 H
Upper-wall bubble ends10.54 H (+0.6%)10.51 H (+0.3%)10.48 H
Iterations to converge1,3072,363 (started from the coarser result)–

The main bubble is long: it reaches the lower wall again 6.09 H downstream, which is 12.2 step heights. Behind it a second, thinner bubble forms on the upper wall, from 4.77 to 10.51 H, never more than 0.18 H thick. The fastest backflow is 0.20 U, near the lower wall at x = 4.8 H. Keep those three facts in mind and watch which views show them.

One result, four views

Figure 2 holds the solved field. It tours the four views on its own. Pick a view to stay on it, then try the controls: change the colour scale, clip its range, thin out the arrows, move the streamline seeds and drag the probe line.

Touring the four views
Quantity
Colour scale
Window
Height drawn
Lower bubble reattachesx = 6.09 Hbenchmark 6.10 H
Upper-wall bubble4.77 to 10.51 Hbenchmark 4.85 to 10.48 H
Fastest reverse flow0.20 Unear the lower wall
Mesh96,000 cellsvelocity residuals below 10⁻⁸

Loading the solved flow field…

Figure 2. One solved result drawn four ways: laminar flow over a backward-facing step at a Reynolds number of 800, solved in OpenFOAM v1912 with simpleFoam on a 1,200 × 80 cell mesh (96,000 cells) and converged until the velocity residuals fell below 10−8. Lengths are in channel heights H (the downstream channel), velocities in the mean inlet velocity U and pressure in ρU², relative to the section at x = 20 H. The figure tours the four views on its own; pick a view, a quantity or a colour scale to stay on it, and the tour resumes after a minute without clicks. The height is stretched three times by default so the thin channel can be read; switch to the true shape to see what the stretch does to arrows and streamlines. The moving tracers in the streamline view travel at the solved local speed, slowed down. Left of x = 0 the imposed inlet profile is drawn; the solved domain starts at the step.

Contours: where it is fast, not which way

A contour plot colours every point by one number: speed, pressure, temperature, concentration. It is the picture most reports lead with, because it shows at a glance where the values are high and low. In Figure 2 the speed contour shows the jet leaving the step and spreading until it fills the channel.

What it hides is direction. On a speed contour the slow liquid in the bubble behind the step looks exactly like the slow liquid near any wall, although one is flowing backwards. Switch the quantity to the axial velocity u on a diverging scale, with white at zero, and both bubbles appear. A contour on a cut plane through a 3D result also says nothing about the flow either side of the plane.

Colour-scale traps

The colour scale decides what the eye sees. These are the traps to look for:

  • Rainbow scales. The rainbow, or "jet", scale is still the default in many CFD programs. Its bright yellow and cyan bands look like sharp changes where the value changes smoothly, and readers with colour blindness cannot put its colours in order (Borland and Taylor 2007; Crameri et al. 2020). A perceptually uniform sequential scale, dark to light like the viridis scale in Figure 2, still reads correctly in grey and for colour-blind readers.
  • A one-way scale for a signed quantity. Velocity components, temperature differences and pressure relative to a reference have a meaningful zero. A diverging scale, with a neutral colour at zero, shows where the sign changes. A sequential scale buries it in a mid colour.
  • Clipped ranges. Set the top of the scale below the maximum and everything above turns one colour. That can be useful, to see detail in slow regions, but it also hides the peak. Look for a colour bar ending in "and above".
  • Each picture on its own range. Most programs fit the scale to each picture. Two designs compared side by side then look alike even when one has twice the velocity. Pictures meant for comparison must share one colour bar.
  • Log scales. A log scale spreads out small values so recirculation stands out, but one colour step then means a tenfold change at the bottom and a small change at the top.
  • Bands. Banded colours are easy to read like a map, but they hide any change inside a band, and the band edges look like features.
  • Stretched axes. Figure 2 stretches the height three times so a channel twenty times longer than it is high can be read. That tilts every arrow and streamline. Switch to the true shape to compare, and always check the axes.

Vectors: direction, at the cost of clutter

A vector plot draws an arrow at each point, pointing the way the liquid moves, with its length showing the speed. It is the quickest way to see recirculation, because the arrows in a bubble point backwards.

The trouble is spacing and scale. Drawn to scale, the arrows in the bubbles are tiny next to the jet, because the backflow is at most 14% of the peak speed. Pack the arrows closer and the picture turns into a grey mat; space them out and they step right over the thin bubble on the upper wall. Making all arrows the same length shows direction everywhere but throws away the speed. On a plane through a 3D result, arrows show only the part of the flow lying in the plane, so a strong swirl through it can vanish.

Streamlines: paths, if the seeds are right

A streamline is a line drawn tangent to the velocity everywhere along it. In a steady flow it is the path the liquid follows, so a set of streamlines is the clearest picture of where the flow goes. In Figure 2 the moving tracers travel at the solved local speed: fast in the jet, crawling around the bubbles.

Streamlines are drawn from seed points, and the seeds decide what you see. Start them all at the inlet and none enters the bubbles, because the bubbles are closed loops that exchange no liquid with the main flow in a steady laminar solution. The picture then suggests smooth flow everywhere. Seeds placed across the channel show both bubbles. In two dimensions the flow between two streamlines is set by the stream function \(\psi\):

\[\psi(x,y) = \int_{-H/2}^{\,y} u\,\mathrm{d}y, \qquad q_{12} = \psi_2 - \psi_1\]

where \(q_{12}\) is the flow per unit depth between streamlines 1 and 2. Only when lines are drawn at equal steps of \(\psi\) does their spacing show the speed: close together where it is fast. Lines seeded at equal spacing on a rake, as most programs do, have no such meaning.

Two more cautions. In an unsteady flow, such as vortex shedding behind a cylinder or a stirred tank, the streamlines of one instant are not the paths particles take; those are pathlines, and dye injected at a point traces a third set, streaklines. And in 3D, streamlines tangle into spaghetti unless the seeds are chosen with care.

Line plots: the exact numbers, on one line only

A line plot samples the result along a line and plots it as a graph. It is the only view that gives numbers you can read off and compare with a hand calculation, a measurement or another design. Drag the probe in Figure 2 across the bubble and the profile of u dips below zero near the wall, crossing zero at the edge of the bubble.

A line along a wall is especially useful. The liquid separates from a wall and reattaches to it where the wall shear stress changes sign:

\[\tau_w = \mu \left.\frac{\partial u}{\partial y}\right|_{\text{wall}} = 0\]

where \(\mu\) is the dynamic viscosity. Figure 3 plots it along both walls of the solved case. That is how the separation and reattachment points in Table 1 were found. On the finer mesh they match the benchmark to within a few hundredths of H at the main bubble and the end of the upper bubble, and to about 0.08 H at the start of the upper bubble, the most sensitive point.

−0.008−0.0040.0000.0040.0080.0120.0160.0200.0240246810121416Distance from the step, x / HWall shear stress, τw / ρU² (positive: the liquid next to the wall moves downstream)6.094.7710.51Lower wallUpper wallBenchmark (Gartling 1990)
−0.0080.0000.0080.0160.0240481216Distance from the step, x / HWall shear stress, τw / ρU²(positive: liquid at the wall moves downstream)6.094.7710.51Lower wallUpper wallBenchmark
Figure 3. Wall shear stress along the lower and upper walls of the solved case (mesh of 96,000 cells), from a second-order velocity gradient at each wall. The sign is taken so that positive means the liquid next to the wall moves downstream on both walls; on the upper wall that is the opposite sign to the equation above, whose y points away from the lower wall. Each sign change marks a point where the flow separates or reattaches. The open triangles show the benchmark positions of Gartling (1990).

What a line plot hides is everything off the line. Move the probe in Figure 2 a little away from the upper wall and the upper bubble disappears from the plot. When a report gives a line plot, ask where the line was drawn and why there.

What each view shows and hides

ViewShowsHides or distortsCheck
ContoursWhere a value is high or low, at a glanceDirection; anything off the cut plane; the true range if the scale is clippedThe colour bar: its limits, its type and whether compared pictures share it
VectorsDirection, and speed when drawn to scaleSlow regions (tiny arrows), thin regions (sparse arrows), flow through the planeThe arrow scale and spacing
StreamlinesPaths of the flow and closed recirculation in steady flowWhatever the seeds miss; real particle paths in unsteady flowWhere the seeds are and whether the flow is steady
Line plotsExact numbers to compare with data or hand calculationsEverything off the lineWhere the line is and why

What to ask a CFD supplier for

A supplier who is confident in the work will provide all of this without fuss:

  • The question and the answer as numbers. Pressure drop, mixing time, peak wall temperature, the size of a dead zone. Pictures support the numbers; they are not the result.
  • The model: geometry and what was simplified, the boundary conditions and where their values came from, fluid properties, and the turbulence model with the reason for it (Part 4).
  • Mesh evidence: the cell count and a mesh study showing the key numbers no longer change (Part 3).
  • Convergence: residual plots and, more important, the key numbers plotted against iterations until they stop changing.
  • Validation: a comparison with a hand calculation, a benchmark or plant data (Part 5).
  • Picture settings: the colour bar on every picture, one range shared by any pictures compared, true aspect ratio or a clear note when it is stretched, and the seeding of streamlines.
  • The data itself: line data as a spreadsheet and the result files in an open format (VTK, EnSight or CGNS), so you can open them in a free viewer such as ParaView and draw your own views.

A checklist for reading a CFD report

QuestionWhy it matters
What decision is the study meant to support?Pictures without a question tend to prove whatever the reader hopes
Is the headline result a number with an uncertainty?A colour field cannot be put in a data sheet or a design review
Does every picture have a colour bar with units?Without it, colours are decoration
Do compared pictures share one colour range?Separate auto ranges make different designs look alike
Is the colour scale sequential, or diverging for signed values?Rainbow scales invent features and fail for colour-blind readers
Is the aspect ratio true, or is a stretch stated?Stretching tilts arrows and streamlines
Where were streamlines seeded and line plots drawn?Seeds and lines decide what you see
Is the flow steady, and if not, is the picture an average or an instant?An instant of an unsteady flow can look very different from its average
Was there a mesh study and a convergence check?A converged solution on a coarse mesh is still a coarse answer
Was the model checked against a benchmark, a hand calculation or plant data?Without a check, nobody knows how far off it is

Common mistakes

  • Reading a speed contour as a flow pattern. It shows how fast, not which way. Look at u, vectors or streamlines before calling a region "stagnant" or "well mixed".
  • Comparing pictures with different colour ranges. Put both designs on one scale before judging which is better.
  • Trusting streamlines started only at the inlet. They cannot show closed recirculation.
  • Taking the stretched picture as the shape. Check the axes before judging angles and thicknesses.
  • Accepting pictures instead of numbers. Ask for the key result as a number, with the mesh and validation evidence behind it.

Key points

  • CFD pictures are drawn by choices. The same result can be made to look calm or alarming.
  • Contours show where values are high or low, not direction. Use a sequential scale, or a diverging one for signed values, and one shared range for comparisons.
  • Vectors show direction but clutter easily and hide slow or thin regions.
  • Streamlines show the paths of a steady flow, but only where the seeds are placed.
  • Line plots give exact numbers for checking, but only along the line.
  • Ask for numbers, mesh and convergence evidence, validation and the data itself, not just pictures.

Next in this series: Part 3 looks at the mesh, and why the same problem can give different answers on different meshes.

The case is the published laminar benchmark of Gartling (1990), solved by the author in OpenFOAM v1912 on the meshes stated. The solver inputs, logs and scripts are kept with this article's sources. Real equipment is three-dimensional and usually turbulent; the reading skills carry over, the numbers do not.

References

  • Gartling, D. K. (1990). A test problem for outflow boundary conditions: flow over a backward-facing step. International Journal for Numerical Methods in Fluids, 11(7), 953–967. doi:10.1002/fld.1650110704
  • OpenCFD Ltd. (2019). OpenFOAM v1912 User Guide. openfoam.com.
  • Crameri, F., Shephard, G. E. and Heron, P. J. (2020). The misuse of colour in science communication. Nature Communications, 11, 5444. doi:10.1038/s41467-020-19160-7
  • Borland, D. and Taylor II, R. M. (2007). Rainbow color map (still) considered harmful. IEEE Computer Graphics and Applications, 27(2), 14–17. doi:10.1109/MCG.2007.323435

Test what you have read

Free Process / ChemEng practice exams

Interactive exams with an explanation for every answer. No sign-up.

Keep reading

Related articles

All 214 articles

Ready to find your next improvement?

Book a strategy call. We will talk through your goals, pain points and where AI, systems or process work can make the biggest difference.