Home / Insights

CFD series · Part 5 of 6

Can You Trust It? Checking CFD Against Hand Calculations

Contents
  1. The five checks
  2. The test case
  3. Check 1: compare with a hand calculation
  4. Check 2: conservation
  5. Check 3: the mesh and y+
  6. Check 4: convergence
  7. Check 5: validation against measurements
  8. What agreement within a few percent means
  9. Red flags in a CFD report
  10. Key points
  11. Sources

A CFD report looks convincing. The colours are smooth, the streamlines are elegant and the numbers come to four decimal places. None of that says the answer is right. A simulation can be wrong because the mesh is too coarse, because it stopped before it settled, because a boundary condition is wrong, or because the physical model does not fit the flow. A reader who cannot tell which of these has happened is trusting the colours.

This is Part 5 of the CFD series. Part 1 covered when CFD is worth paying for, Part 2 how to read a result, Part 3 the mesh and Part 4 turbulence models. This part puts them to work. It takes a pipe that was already sized by hand in Part 5 of the equipment sizing series, solves it in CFD and runs five checks a process engineer can do on any CFD result, in an afternoon, with a calculator and a spreadsheet. Part 6 closes the series with what CFD costs.

The five checks

Figure 1 is the checklist. The first four checks ask whether the equations were solved correctly. Engineers call this verification. The fifth asks whether they were the right equations for this flow, which is validation. A result can pass verification and still be wrong if the model does not fit the physics. It can never pass validation without verification first.

1Hand calculationDoes it agree with acalculation you trust?2ConservationDoes mass and energycome out even?3Mesh and y+Does the answer stay puton a finer mesh?4ConvergenceHave the monitoredresults stopped moving?5ValidationDoes it match measureddata for a similar case?Checks 1 to 4 ask whether the equations were solved right (verification).Check 5 asks whether they were the right equations for the job (validation).
1Hand calculationDoes it agree with a calculation you trust?2ConservationDoes mass and energy come out even?3Mesh and y+Does the answer stay put on a finer mesh?4ConvergenceHave the monitored results stopped moving?5ValidationDoes it match data for a similar case?1 to 4: verification (solved right).5: validation (the right equations).
Figure 1. The five checks to run on any CFD result, in order. A result that fails an early check is not worth validating.

The test case

The pipe is line 40-P-1002, the discharge of pump P-101 from the equipment sizing series: 1½-inch schedule 40, with a bore of 40.94 mm. It carries 8.09 m³/h of a liquid with a density of 850 kg/m³ and a viscosity of 0.60 mPa·s. The mean speed is 1.71 m/s and the Reynolds number is 99,000, so the flow is turbulent. The hand calculation in that article gave a friction factor of 0.0227 and a loss of 68.6 kPa per 100 m, using a wall roughness of 0.045 mm for commercial steel.

Three CFD models were set up in OpenFOAM v1912, a free, open-source CFD package, and run on a single processor core:

CaseWhat is solvedModel and meshRun time
Straight pipe, turbulentThe design liquid at 50%, 75%, 100% and 125% of the rated flowFully developed flow in a thin 5° wedge of the pipe (±2.5°), the two ends joined so the flow repeats, driven at the set mean speed; k-epsilon with the rough-wall function at 0.045 mm; 18 cells from the axis to the wall2 s
Straight pipe, laminarA 60 mPa·s oil at the rated flow (Re 990)Same wedge, no turbulence model, 30 cells2 s
90° bendThe design liquid at the rated flowFull 3D long-radius bend (bend radius 1.5 bores), 40 bores of straight pipe before it and 80 after; k-epsilon, rough wall; 108,000 cells3 min

A pipe is a deliberately simple test. The answer is known well enough that every disagreement can be traced to its cause. Figure 2 shows the solved results and the checks side by side. The rest of this article works through them one at a time.

Solved

Loading the solved results…

Check
Solved at 50, 75, 100 and 125%. In between, the CFD values are interpolated, never extrapolated.
CFD, kPa per 100 m–
Hand calculation–
Difference–
Reynolds number–
First-cell y+–
Mass balance–

Figure 2. The trust checks on the 1½-inch line of equipment sizing Part 5, solved in OpenFOAM v1912. Straight pipe: fully developed flow in an axisymmetric wedge, laminar for a 60 mPa·s oil and k-epsilon with the rough-wall function for the design liquid. Bend: a 3D 90-degree long-radius bend (bend radius 1.5 bores) with 40 bores of straight pipe before it and 80 after, 108,000 cells. It was run on one mesh, so it is a consistency check against the published methods rather than full validation. The hand calculations are Hagen–Poiseuille, Colebrook with 0.045 mm roughness, and the bend loss correlations named in the article. The streaks are slowed down. In the bend they move along lines parallel to the wall at the solved speed: the secondary flow is shown only in the two cross-sections. The figure tours the four views on its own until you pick one.

Check 1: compare with a hand calculation

Before any CFD is run, write down the number you expect and how you got it. For pipe friction the hand calculation is the Darcy–Weisbach equation. For a fully developed pipe, the CFD's friction factor follows from the pressure gradient it solves, and that is the number to compare:

\[f_{\text{CFD}} = \dfrac{2\,D}{\rho\,v^{2}}\,\dfrac{\Delta P}{L}\]

Start where the answer is exact

Laminar pipe flow has an exact solution, the Hagen–Poiseuille equation. Nothing is modelled, so any difference is the solver's own error:

\[\dfrac{\Delta P}{L} = \dfrac{32\,\mu\,v}{D^{2}}, \qquad f = \dfrac{64}{Re}\]

For the 60 mPa·s oil at the rated flow, Hagen–Poiseuille gives 195.5 kPa per 100 m. The CFD gives 195.8, a difference of +0.14%. The fastest cell, next to the axis, moves at 1.997 times the mean speed, against an exact 2 on the axis itself. This takes seconds to run, and it shows that the solver, the mesh and the boundary conditions behave. If a CFD supplier cannot reproduce a textbook case like this with their own setup, nothing else they produce can be trusted.

Then the real case

For the design liquid the hand calculation uses the Colebrook equation, which the Swamee–Jain formula of Part 5 of the equipment sizing series approximates within 0.8%:

\[\dfrac{1}{\sqrt{f}} = -2\log_{10}\!\left(\dfrac{\varepsilon}{3.7\,D} + \dfrac{2.51}{Re\,\sqrt{f}}\right)\]

Flow, % of ratedReCFD, kPa/100 mColebrook, kPa/100 mDiff.y+
50%49,50015.318.4−16.5%35
75%74,20032.639.4−17.2%50
100%99,00056.768.1−16.8%67
125%123,70087.8104.4−15.9%83

At the rated flow the CFD gives 56.7 kPa per 100 m against Colebrook's 68.1, which is −16.8%. The gap is the same at every flow. That is a disagreement worth understanding, not hiding. There are two candidates: the turbulence model, or the way the two methods treat wall roughness.

The test is to take roughness out. With a smooth wall, Colebrook gives 54.5 kPa per 100 m. The same k-epsilon CFD with a smooth wall gives 52.8 (−3.2%), and the SST model resolved right down to the wall stays within about 2% once its first cell is fine enough (Check 3). So about 3 points of the 17% gap come from the k-epsilon model and about 14 from roughness (Figure 3).

0.0140.0160.0180.0200.0220.0240.02650,00075,000100,000125,000Darcy friction factorReynolds numberColebrook, 0.045 mm (hand calculation)Colebrook, smooth wallColebrook, 0.006 mmCFD, rough wall (k-epsilon), four flowsCFD, smooth wall (k-epsilon)CFD, smooth wall (SST, wall-resolved)
Figure 3. Friction factor against Reynolds number. With a smooth wall, the CFD and Colebrook agree within a few percent. With 0.045 mm roughness, the CFD sits much closer to the smooth curve than to Colebrook.

The reason is the transitional region. In wall units (the roughness height times the friction velocity, divided by the kinematic viscosity) the roughness here is about 5, about as tall as the viscous sublayer. OpenFOAM's rough-wall function, Cebeci and Bradshaw's fit to Nikuradse's sand-grain experiments, adds about 7% to the friction at this height. Colebrook's equation, fitted to commercial pipe, lets roughness take effect earlier and more gradually and adds about 25%. Measurements in a commercial steel pipe at Princeton found the change from smooth to rough "much more abrupt" than Colebrook suggests (Langelandsvik, Kunkel and Smits, 2008). Colebrook only agrees with this CFD if the roughness is cut from 0.045 to 0.0058 mm. The rough-wall function also has a roughness constant, Cs, left here at its default of 0.5 for uniform sand grains. Raising it to 1.0, a common choice for irregular roughness, gives 60.1 kPa per 100 m and closes the gap to −11.7%. The CFD's rough-wall answer is a modelling choice, not a measurement.

So which number goes on the line list? For design, the 69 kPa per 100 m stands. Colebrook with 0.045 mm is the industry convention. For new, clean pipe it probably errs high, and real pipe gets rougher with age. The CFD does not overturn the hand calculation. It suggests a new line could lose less, somewhere between about 57 and 68 kPa depending on the roughness model and the actual pipe, which matters if a pump is being trimmed for a tight efficiency guarantee. The lesson is general: when the CFD and the hand calculation disagree, find the input they treat differently before believing either. Most of the time it is an input, such as roughness, viscosity or the inlet condition, not the solver.

Check 2: conservation

Whatever goes in must come out. These checks need nothing but the CFD's own outputs:

  • Mass. In the bend run, the flow leaving the outlet equals the flow entering the inlet, 8.055 m³/h, to better than 0.01%. A report should state the imbalance. Anything above about 0.1% on a steady incompressible case means the run is not converged or a boundary is leaking. Note that the flow is 0.4% below the rated 8.09 m³/h. The inlet was set at the design mean speed, and the mesh draws the round pipe as a 40-sided polygon whose area is 0.4% smaller than the circle. The speeds, and so the loss coefficient, are unaffected, but this is the kind of small geometry difference the check is there to catch.
  • Energy. The pressure lost becomes heat. At the rated flow 100 m of line turns 127 W of pumping into heat, enough to warm the liquid by 0.03 K. That confirms the CFD was right to ignore temperature. In a long viscous-oil line or a high-speed recirculation loop, the same check might say the opposite.

Check 3: the mesh and y+

Part 3 explains why the same problem gives different answers on different meshes. Two things need checking: whether the answer has stopped changing as the mesh is refined, and whether the cells next to the wall suit the turbulence model. The second is measured by y+, the distance of the first cell centre from the wall in wall units:

\[y^{+} = \dfrac{u_\tau\, y}{\nu}, \qquad u_\tau = \sqrt{\tau_w / \rho}\]

In fully developed pipe flow the wall shear follows from the force balance, \(\tau_w = \tfrac{D}{4}\,\tfrac{\Delta P}{L}\). That is a definition, not a check, but it gives 5.80 Pa and a friction velocity of 0.083 m/s for the y+ values below.

Models that use wall functions, like the k-epsilon runs here, bridge the thin layer near the wall with a formula. They need the first cell inside the log-law layer, roughly y+ of 30 to 300. Models resolved to the wall, like SST here, solve that layer directly and need y+ below about 1.

ModelRadial cellsFirst-cell y+kPa per 100 mChange
k-epsilon, wall function1210056.72+0.03%
k-epsilon, wall function186756.700.00%
k-epsilon, wall function274456.63−0.13%

With wall functions, 12, 18 and 27 cells give the same answer within 0.16%, with y+ between 44 and 100. Refining further would push the first cell out of the log-law layer and break the wall function's assumption. With a wall function, "finer" is not always better.

The wall-resolved SST model shows the opposite trap. The change column below is against smooth-wall Colebrook:

ModelRadial cellsFirst-cell y+kPa per 100 mvs Colebrook
SST, resolved to the wall404.6356.37+3.4%
SST, resolved to the wall801.1250.95−6.5%
SST, resolved to the wall1000.2654.14−0.7%
SST, resolved to the wall1200.1754.68+0.3%
SST, resolved to the wall1600.0855.29+1.4%
SST, resolved to the wall2000.0455.58+2.0%

The answer swings from +3.4% to −6.5% as the wall cell shrinks towards y+ = 1. Near y+ = 1.1, with OpenFOAM's wall condition for omega, it is 6.5% low, at a y+ that would pass most guidelines. Below y+ of about 0.3 it stays within about 2% of smooth Colebrook (−0.7% to +2.0%), though it still drifts slowly as the wall cell shrinks (+2.0% at y+ 0.04). There is no single "right" mesh, only a range where the answer is stable enough for the decision. Only a mesh study exposes this. A report that gives one mesh and no y+ has not done the check.

Check 4: convergence

A steady CFD run is an iteration: the solver guesses, measures how badly the equations are out of balance (the residuals), corrects and repeats. Stopping too early gives an answer that is still moving. The usual advice is to watch the residuals fall, and also to monitor the quantity you care about and see it go flat.

0204060800200400600steady to 0.01%from iteration 187Straight pipe: monitored pressure drop, kPa per 100 mIteration11e-21e-41e-61e-81e-100200400pressurevelocitykepsilontarget, 1e-690° bend: residuals (log scale)Iteration
Figure 4. Two convergence checks. Left: the monitored result of the straight-pipe run. Right: the residuals of the bend run.

Both matter, and neither is enough alone. In the bend run every residual fell below its target and the solver stopped itself after 417 iterations. Between iteration 250 and the end, the pressure 20 bores upstream of the bend changed by less than 0.001%. In the straight-pipe run, the monitored pressure drop was steady to 0.01% from iteration 187, but the pressure residual stayed near 0.06 to the end. That is because in a fully developed pipe, the pressure left over after the driving gradient is removed is almost zero, so its scaled residual measures round-off. A report that shows only residuals cannot tell those two situations apart. Ask for the monitor plots.

Check 5: validation against measurements

The first four checks show the equations were solved well. Only measured data shows they were the right equations. Straight pipe friction is so well known that it hardly counts. A pipe bend is a better test. The liquid is thrown to the outside of the bend, a pair of counter-rotating swirls forms (the cross-sections in Figure 2) and the flow takes many diameters to recover. Those are things a hand calculation cannot see.

Be clear about what this test is. The bend was run on one mesh (108,000 cells, first-cell y+ about 59) with the rough-wall function, while Ito measured smooth bends. Without a mesh study its K carries an unquantified mesh error, so this is a consistency check against published data rather than full validation.

The CFD's loss coefficient is the extra pressure drop of the bend in velocity heads (\(\rho v^2/2\) = 1.24 kPa here). It is found by fitting straight lines to the pressure before and after the bend, where the flow is fully developed, and taking the step between them:

\[K = \dfrac{\Delta P_{\text{bend}}}{\rho\, v^{2}/2}\]

SourceBasisK, 90° bend, r/D = 1.5CFD difference
This CFDk-epsilon, 108,000 cells0.26 (0.254 to 0.261 by fitting method)
Ito (1960), as given by Blevins (1984)Measurements on smooth bends0.23+14.7%
Rennels and Hudson (2012)Correlation of published data0.26−1.3%
Crane TP-41014 \(f_T\), with \(f_T\) = 0.021 for 1½-inch pipe0.29−11.3%
Part 5 of the equipment sizing seriesElbows as 30 pipe diameters (a standard, short elbow)0.68

The CFD lands at 0.26: +15% against Ito's smooth-bend measurements, −1% against Rennels and Hudson and −11% against Crane. That is inside the spread of the published methods, which themselves differ by about 29%, so the result is consistent with them. It is not proof that the k-epsilon model gets bends right.

Where the lines are fitted matters. The pressure gradient after the bend is steeper than in straight pipe and only returns to within 1% of the straight-pipe value about 40 bores downstream. Fitting the downstream line 20 to 35 bores out, still inside that recovery zone, gives K = 0.237, 9% low. A first run of this case had only 40 bores after the bend, so it could only be fitted there. The rerun has 80 bores and fits 55 to 78 bores out, where the flow has settled. Two practical points follow. First, two fittings closer than about 40 bores interact, and adding their K values is then only an estimate. Second, if the line uses long-radius elbows (on this bore their radius is 1.4 bores, close to the 1.5 modelled), each loses about 38% of what the sizing article allowed for a standard elbow, so the line's 60 m equivalent length is conservative.

What agreement within a few percent means

Compared withAgreement to expect (rule of thumb)What a bigger gap points to
An exact solution (laminar pipe, simple channel)Better than 1%The mesh, the boundary conditions or the setup
A good correlation for a simple flow (pipe friction, heat transfer in a straight tube)About 2 to 5%The turbulence model, y+, or an input such as roughness
A fitting or equipment correlation (bends, tees, valves, baffles)About 10 to 20%The correlations disagree with each other this much. Check against the closest measured data
Plant measurementsDepends on the instrumentsOften the plant is not what the drawings say: fouling, a different impeller, a part-open valve

Agreement within 2% between two methods with different assumptions is not proof that both are right. It is evidence. The engineer's job is to know which assumptions each method makes, and which of them could be wrong for this case.

Red flags in a CFD report

  • No hand calculation. Every CFD study can be bracketed by a rough calculation of the same quantity. If the report has none, ask for one.
  • One mesh, no y+. Without a mesh study the error is unknown. Without y+ you cannot tell whether the wall treatment was used inside its range.
  • Residual plots only. Ask for monitors of the quantities the decision rests on: pressure drop, heat duty, peak velocity, mixing time.
  • Inputs not stated. Roughness, viscosity, density, inlet profile, turbulence intensity. Small changes in these often matter more than the model.
  • An inlet too close to the feature. A uniform inlet one diameter before a bend gives a different answer from a developed flow. The runs here used 40 bores.
  • Losses read too close to the fitting. Pressure measured or fitted inside the recovery zone understates the loss, as the first bend run here showed.
  • "Validated" with no data. Validation means comparison with named measurements for a similar flow, with the difference stated.
  • Colour scales chosen to impress. Auto-scaled or unlabelled colour bars can make a 1% variation look dramatic. See Part 2.
  • A steady solution of an unsteady flow. Vortex shedding, sloshing and some stirred tanks never settle. A steady run of them that "converged" has averaged away the physics.
  • A mass imbalance not reported, or one above about 0.1% on a steady incompressible case.

Key points

  • Run the five checks on every CFD result: hand calculation, conservation, mesh and y+, convergence, validation.
  • Start with a case that has an exact answer. Here the laminar pipe agreed with Hagen–Poiseuille to 0.14%.
  • When CFD and a hand calculation disagree, look for the input they treat differently. Here most of the 17% gap (about 14 points) came from how the two methods model roughness, and about 3 points from the k-epsilon model.
  • Check y+ against what the turbulence model needs, and refine the mesh until the answer stops moving. A wall-resolved model was 6.5% out at a y+ of about 1, and within about 2% below 0.3.
  • Watch the result you care about become steady, not just the residuals.
  • Validate against measured data for a similar flow, and say what the comparison can and cannot show. The bend's K of 0.26 sits inside the spread of the published methods (0.23 to 0.29).

Sources

  1. Colebrook, C. F. (1939). Turbulent flow in pipes, with particular reference to the transition region between the smooth and rough pipe laws. Journal of the Institution of Civil Engineers, 11(4), 133–156.
  2. Nikuradse, J. (1933). Strömungsgesetze in rauhen Rohren. VDI-Forschungsheft 361. English translation: Laws of flow in rough pipes, NACA Technical Memorandum 1292 (1950).
  3. Cebeci, T. and Bradshaw, P. (1977). Momentum Transfer in Boundary Layers. Hemisphere Publishing Corporation, Washington, DC (McGraw-Hill).
  4. Langelandsvik, L. I., Kunkel, G. J. and Smits, A. J. (2008). Flow in a commercial steel pipe. Journal of Fluid Mechanics, 595, 323–339.
  5. Ito, H. (1960). Pressure losses in smooth pipe bends. Journal of Basic Engineering, 82(1), 131–140.
  6. Blevins, R. D. (1984). Applied Fluid Dynamics Handbook. Van Nostrand Reinhold.
  7. Rennels, D. C. and Hudson, H. M. (2012). Pipe Flow: A Practical and Comprehensive Guide. Wiley.
  8. Crane Co. (2009). Flow of Fluids Through Valves, Fittings, and Pipe, Technical Paper No. 410.
  9. Launder, B. E. and Spalding, D. B. (1974). The numerical computation of turbulent flows. Computer Methods in Applied Mechanics and Engineering, 3(2), 269–289.
  10. Menter, F. R. (1994). Two-equation eddy-viscosity turbulence models for engineering applications. AIAA Journal, 32(8), 1598–1605.
  11. ASME V&V 20-2009 (R2021). Standard for Verification and Validation in Computational Fluid Dynamics and Heat Transfer.

Next in the series: Part 6 sets out what CFD costs a small company: buying, outsourcing or building it in-house.

The pipe, liquid and flows are the illustrative example of the equipment sizing series. The CFD cases, scripts and results are in the site's repository under content/cfd/part5/. A real design check uses the project's own data and a qualified engineer.

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.