Pipe flow calculator

Type the diameter, length, fluid and a Reynolds number, velocity or flow rate. You get the regime, the mean and centreline velocity, the entrance length, the pressure drop (Hagen-Poiseuille when laminar, Colebrook when turbulent) with and without the entrance region, and the wall shear stress. Free, no sign-up, runs in your browser.

For OpenFOAM it also gives the kinematic pressure the solver prints and writes a wedge blockMeshDict for the axisymmetric case. It opens on the pipe-flow challenge of Skill-Lync's OpenFOAM course; the second tab checks the numbers in your report and names the usual slips.

Hagen-Poiseuille · Shah 1978 · Durst et al. 2005 · Colebrook 1939 · checked in OpenFOAM v2412 · Updated 20 Nov 2026

Water at 25 °C is what most reports of the challenge use (ν ≈ 8.9 × 10⁻⁷ m²/s). Roughness only matters when the flow is turbulent: 0.045 mm is the usual value for commercial steel, 0.0015 mm for drawn tubing.

OpenFOAM wedge blockMeshDict
  • checkMesh will report each wedge patch at 2°. 9,000 cells; axial spacing 10 mm, radial 0.613 mm at the axis to 0.153 mm at the wall (aspect ratio 65.3 there).
  • transportProperties: nu 8.92656e-7; inlet U (0.0937289 0 0). Wall on the mid-plane at r = 9.9939 mm (straight edges).
  • sum(phi) at the outlet should read 3.269e-7 m³/s; × 2π/sin θ = 90.073 gives the pipe's 2.945e-5 m³/s.
  • icoFoam: deltaT about 0.027 s for a Courant number of 0.5 at 2U; flow-through time 32 s, viscous time R²/ν 112 s. Run for several of the longer one, or until the outlet centreline velocity stops changing.
system/blockMeshDict
/*--------------------------------*- C++ -*----------------------------------*\
  Wedge (axisymmetric) pipe: D = 0.02 m, L = 3 m, wedge 4 deg
  Axis along x, wedge split by the x-y plane. From skill-lync.com/tools/pipe-flow-calculator
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}

scale   1;

vertices
(
    (0 0 0)                             // 0
    (0 0.00999390827 -0.000348994967)   // 1
    (0 0.00999390827 0.000348994967)    // 2
    (3 0 0)                             // 3
    (3 0.00999390827 -0.000348994967)   // 4
    (3 0.00999390827 0.000348994967)    // 5
);

blocks
(
    // x1 = axial (0 -> 3), x2 = radial (3 -> 4); vertices 0 and 3 repeat: the cells touching the axis collapse to prisms
    hex (0 3 4 1 0 3 5 2) (300 30 1) simpleGrading (1 0.25 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces ((0 1 2 0));
    }
    outlet
    {
        type patch;
        faces ((3 5 4 3));
    }
    wall
    {
        type wall;
        faces ((1 4 5 2));
    }
    front
    {
        type wedge;
        faces ((0 3 5 2));
    }
    back
    {
        type wedge;
        faces ((0 1 4 3));
    }
    axis
    {
        type empty;
        faces ((0 3 3 0));
    }
);

// ************************************************************************* //
Reynolds number2,100Laminar, U = 0.09373 m/s
Pressure drop25.50 Pa20.02 Pa fully developed
Entrance length2.38 m119 D, Durst et al.
Pressure drop from the inlet along the pipe: fully developed straight line and the developing-flow curve, with the entrance region shaded010203000.511.522.53entrance regiondistance from inlet x (m)Hagen-Poiseuillewith entrance (Shah)Δp from inlet (Pa)
  • Laminar: developed centreline velocity 0.1875 m/s (2U); flow rate 1.767 L/min, 29.36 g/s.
  • Δp: 20.02 Pa fully developed (Hagen-Poiseuille), 25.5 Pa from a uniform inlet (+ 1.25 × ½ρU² = 5.474 Pa for the entrance). Kinematic, as OpenFOAM prints it: 0.02008 / 0.02557 m²/s².
  • Wall shear stress (developed): 0.03337 Pa (kinematic 3.347e-5 m²/s²); pressure gradient 6.674 Pa/m.
  • Entrance length: 2.382 m (Durst et al.), 2.1 m (0.05 Re D), 2.52 m (0.06 Re D). The pipe is 1.26 times as long.
Laminar pipe velocity profile: uniform inlet and the fully developed parabola, u over the mean velocity against r over R00.511.52-101uniform inlet2U(1 − r²/R²)u / U (mean)r/R

Dots: the outlet profile from Skill-Lync's OpenFOAM v2412 run of the course case (300 × 30 cells, 4° wedge).

What is the OpenFOAM pipe-flow challenge?

It is the laminar validation case of Skill-Lync's Introduction to CFD using MATLAB and OpenFOAM course, and 571 distinct public student reports cover it (329 titled "Week 11 - Simulation of Flow Through a Pipe in OpenFOAM"). The brief: simulate laminar flow through a pipe at an inlet Reynolds number of 2,100 with icoFoam, as an axisymmetric wedge; write a MATLAB program that generates the blockMeshDict for any wedge angle and grading; then validate the result against Hagen-Poiseuille: the entrance length, the developed velocity profile, the maximum velocity, the pressure drop and the wall shear stress. A second part repeats it with symmetry planes at wedge angles of 10°, 25° and 45°.

The brief leaves the diameter and the fluid to you. Most reports pick a 20 mm pipe (10 mm is next) and water at 25 °C, ν = 8.9 × 10⁻⁷ m²/s (197 reports; 129 use the rounded 1 × 10⁻⁶). The calculator opens on that case.

Hagen-Poiseuille: the numbers for Re 2,100

The Reynolds number fixes the mean velocity, and once the flow is fully developed the profile is a parabola with twice the mean velocity on the axis:

The pressure drop and the wall shear stress follow, and are tied by a force balance on the fluid:

CaseUΔp over Lτw
D 20 mm, L 3 m, water 25 °C0.09373 m/s20.02 Pa0.0334 Pa
D 20 mm, L 3 m, ν = 1 × 10⁻⁶0.105 m/s25.20 Pa0.042 Pa
D 10 mm, L 1.5 m, water 25 °C0.1875 m/s80.08 Pa0.133 Pa

The centreline velocity is twice U in each case. At a fixed Reynolds number, halving the diameter doubles the velocity and, over the same number of diameters, quadruples the pressure drop. Rounding ν to 1 × 10⁻⁶ moves U by 12% and Δp by 26%. Neither is wrong, but the inlet velocity, transportProperties and the hand calculation have to use the same ν.

Which entrance length formula: 0.05 Re D or 0.06 Re D?

They measure different things. Çengel and Cimbala's 0.05 Re D is where the wall shear stress gets within about 2% of its developed value; 0.06 Re D (quoted from White) and Langhaar's 0.058 are closer to where the centreline velocity reaches 99% of 2U. In the reports, 258 use 0.06 Re D, 116 use 0.05 Re D and 22 use Langhaar's 0.058 (0.0575 in some notes); none uses the modern fit of Durst, Ray, Ünsal and Bayoumi (2005), who computed the length at which the centreline velocity reaches 99% of its developed value:

The 0.619 term matters only at low Reynolds numbers, where the flow still needs about 0.6 D to develop when the Re-proportional rules say almost nothing. At Re 2,100 in a 20 mm pipe the three give 2.10 m, 2.38 m and 2.52 m. In Skill-Lync's OpenFOAM runs of that case the centreline velocity reached 99% of 2U at 2.54 m on the 300 × 30 mesh (95% at 1.32 m); the outlet centreline reads 98.7% of 2U on 150 × 15, 99.4% of 2U on 300 × 30, 99.5% of 2U on 450 × 45. A coarse radial mesh smears the profile and makes the flow look slower to develop. So pick a pipe comfortably longer than any of them: 3 m (150 D) leaves a developed stretch at the end to validate against. A pipe exactly 0.06 Re D long (2.52 m) ends about where the flow becomes developed, so it leaves nothing to validate against; at 0.05 Re D (2.10 m) the outlet is still developing.

Turbulent flow develops much faster: 1.359 Re1/4 D (Çengel and Cimbala, who also give 10 D as a working figure) or 4.4 Re1/6 D (the form quoted from White), typically 10 to 40 diameters. The calculator switches to these above Re 4,000.

Why is the CFD pressure drop higher than Hagen-Poiseuille?

Because Hagen-Poiseuille is the pressure drop of fully developed flow, and the challenge feeds the pipe a uniform velocity. Turning a flat profile into a parabola speeds up the core and shears the fluid hard near the wall in the first part of the pipe, which costs extra pressure. Past the entrance region that extra settles at a constant number of dynamic heads, the incremental pressure drop K(∞), 1.25 for a round tube (Shah 1978):

For the course case K(∞) adds 5.47 Pa to 20.02 Pa: 25.50 Pa from inlet to outlet, 27% above Hagen-Poiseuille. Skill-Lync ran it in OpenFOAM v2412 with this page's blockMeshDict (4° wedge, uniform inlet, steady laminar):

MeshInlet p (Pa)τw (Pa)uc/2U, outlet
150 × 1525.530.03370.987
300 × 3025.550.03360.994
450 × 4525.55–0.995
Hagen-Poiseuille20.020.03341
With K(∞) = 1.2525.50

The 450 × 45 run was stopped after it had converged, before it wrote its fields: its inlet pressure and centreline velocity come from the run's monitors, and it has no wall shear value. Each refinement moves the inlet pressure less (25.532, 25.550, 25.554 Pa).

The run lands on the entrance-corrected value, not on Hagen-Poiseuille, while its wall shear stress and its pressure gradient over the last 20% of the pipe (6.742 and 6.753 Pa/m on the 150 × 15 and 300 × 30 meshes, against 6.674) match Hagen-Poiseuille within about 1%. Only 3 of the 571 reports mention the entrance region's extra pressure drop. To validate the developed flow, take Δp between two stations past the development length (or fit the slope of p along the axis there) and compare it with 32μU/D² per metre.

For a pipe shorter than the development length, the calculator uses Shah's (1978) correlation for the apparent friction factor of the entrance region, which the chart draws along the pipe:

(C is 2.12 × 10⁻⁴ for a round tube; the constants differ for other duct shapes.) At the end of the course pipe it gives 25.12 Pa, 1.5% under the K(∞) form; the OpenFOAM runs sit closer to the K(∞) form, which is why the calculator uses it once the pipe is longer than the development length.

OpenFOAM's pressure is not in pascals

icoFoam, simpleFoam and pimpleFoam solve the incompressible equations divided by the density, so the p they print and write is the kinematic pressure, with dimensions [0 2 -2 0 0 0 0]:

For the course case the run reports an inlet p of 0.02563 m²/s², which is 25.55 Pa. 323 reports convert between the two; 15 print the kinematic value with a pascal unit, a drop of 0.0201 "Pa" that is really 20.02 Pa. The same applies to a boundary value: setting the outlet p to 0.02 sets 0.02 m²/s², about 20 Pa. And OpenFOAM's wallShearStress function object, in an incompressible case, writes τ/ρ: 0.0000335 m²/s² for the course case, 0.0334 Pa.

The wedge mesh, and three things checkMesh tells you

An axisymmetric case in OpenFOAM is a thin slice of the pipe, one cell thick, its two sides set as wedge patches. The generator in the calculator writes it with the axis along x and the slice split by the x-y plane; the cells touching the axis collapse to prisms, and the axis is an empty patch with no faces. Skill-Lync ran blockMesh and checkMesh on its output at 2°, 4°, 10° and 45°: Mesh OK at every angle. Three things to know when you read the output:

  • checkMesh reports half your angle. A 4° wedge shows "Wedge front with angle 2 degrees" and "Wedge back with angle 2 degrees": each patch is measured from the mid-plane.
  • The wall is a flat chord. blockMesh joins vertices with straight edges unless you add arcs, so the wall sits at R cos(θ/2) on the mid-plane, 9.994 mm instead of 10 mm for a 4° wedge. The flow area is off by only 0.08%, but a wall shear stress taken from the wall cell's velocity over its distance to r = R comes out several percent low. Measure the distance to the chord.
  • The flux through the slice is not the pipe's flow rate. sum(phi) at the outlet is U times the triangle area R² sin(θ)/2 (the 300 × 30 run gave 3.26910e-7 m³/s against 3.26910e-7 from the formula). Scale it up by:

Why under 5°? The wedge condition treats the slice as if it had no circumferential extent; a thin wedge keeps the cells near the axis close to the true geometry. The challenge's part 2 uses symmetry planes at 10°, 25° and 45° to show what changes when the angle grows. Mesh near the wall rather than the axis: with grading 0.25 and 30 cells, the wall cell is 0.153 mm against 0.613 mm at the axis.

How long to run icoFoam? Two time scales: the flow-through time L/U, 32 s for the course case, and the viscous time R²/ν, 112 s, over which the profile across the pipe settles. Run for several of the longer one, or until the centreline velocity at the outlet stops changing, before reading the profile. The time step follows from the Courant number on the axial spacing at the centreline velocity; the calculator prints it.

Turbulent pipe flow: Colebrook, Haaland, Swamee-Jain

Above Re 4,000 the friction factor depends on the wall roughness ε as well, through the Colebrook-White equation, which the calculator solves exactly:

Haaland's (1983) and Swamee and Jain's (1976) explicit formulas avoid the iteration (Çengel and Cimbala put Haaland within 2% of Colebrook); the calculator shows both next to Colebrook. For water at 20 °C and 1.5 m/s in a 50 mm commercial steel pipe (ε = 0.045 mm), Re = 74,746: Colebrook f = 0.0225, Haaland 0.0223, Swamee-Jain 0.0227, and 5.06 kPa over 10 m. Between 2,300 and 4,000 the flow is transitional and no formula is reliable; the calculator uses Colebrook there and says so.

Which slips does the check tab catch?

Skill-Lync read all 571 OpenFOAM pipe-flow reports on 20 Nov 2026. The Check tab tests your numbers against each of these:

  • Kinematic pressure in pascals: 0.0201 "Pa" for 20.02 Pa, and the same for wall shear.
  • Inlet-to-outlet Δp compared with Hagen-Poiseuille: the 27% gap is the entrance region, not the mesh.
  • The centreline velocity as the inlet velocity: 0.1875 m/s instead of 0.09373 m/s doubles Re.
  • Two values of ν: 1 × 10⁻⁶ for the inlet velocity (0.105 m/s) and 8.9 × 10⁻⁷ in transportProperties, or the reverse, runs a different Reynolds number from the one validated.
  • 8μU/D with the centreline velocity: twice the wall shear stress.
  • A pipe too short, or a run too short: a centreline velocity below 2U at the outlet.

What this calculator does not cover

  • Fittings, bends and valves. Minor losses (K values per fitting) add to the straight-pipe drop; the page gives none rather than an unsourced table.
  • Non-circular ducts, non-Newtonian fluids and compressible gas flow. Hagen-Poiseuille and Shah's constants here are for a round tube and a Newtonian fluid at constant density; a gas line with a large pressure drop needs a compressible calculation.
  • Heat transfer. The thermal entrance length and Nusselt numbers are a separate problem.
  • The transitional range. Between Re 2,300 and 4,000 the flow can be laminar, turbulent or intermittent depending on the inlet and disturbances.
Learn CFD

A laminar pipe is the one CFD case with an exact answer, which makes it the place to learn what a mesh, a boundary condition and a solver do to a result. It is the validation project of Skill-Lync's OpenFOAM course.

Frequently asked questions

How do you calculate pressure drop in laminar pipe flow?

With the Hagen-Poiseuille equation, Δp = 32 μ L U / D², which is the Darcy-Weisbach equation with f = 64/Re. It holds for fully developed laminar flow, Re below about 2,300. For water at 25 °C in a 20 mm pipe at Re 2,100 (U = 0.09373 m/s) it gives 20.02 Pa over 3 m. If the flow enters with a uniform velocity, the entrance region adds about 1.25 dynamic heads, 5.47 Pa, for 25.50 Pa in total.

What is the entrance length for laminar pipe flow?

About 0.05 to 0.06 Re D, depending on the book; Durst et al. (2005) fit L/D = [0.619^1.6 + (0.0567 Re)^1.6]^(1/1.6) to their computations, the length at which the centreline velocity reaches 99% of its developed value. At Re 2,100 in a 20 mm pipe that is 2.38 m (0.05 Re D gives 2.10 m, 0.06 Re D 2.52 m).

Why is my OpenFOAM pressure drop higher than Hagen-Poiseuille?

Because a uniform inlet velocity has to develop into the parabola first, and that costs extra pressure: K(∞) ≈ 1.25 times ½ρU² (Shah 1978). For the course case that is 5.47 Pa on top of 20.02 Pa. Skill-Lync ran this page's own wedge mesh in OpenFOAM v2412: the inlet pressure came out at 25.55 Pa, 28% above Hagen-Poiseuille and 0.2% from the entrance-corrected value. Compare Hagen-Poiseuille with the pressure gradient past the development length instead.

Is OpenFOAM pressure in pascals?

Not in the incompressible solvers. icoFoam, simpleFoam and pimpleFoam solve for the kinematic pressure p/ρ, in m²/s²; multiply by the density to get pascals. The same goes for the incompressible wallShearStress function object, which writes τ/ρ.

What wedge angle should I use in OpenFOAM?

A small one, under 5° is the usual advice, one cell thick, split symmetrically by a coordinate plane, with the two sides as wedge patches. checkMesh reports each wedge patch at half the total angle, so a 4° wedge shows 'angle 2 degrees' twice. The wall of a blockMesh wedge is a flat chord at R cos(θ/2), not the arc, which matters if you read the wall shear from the wall cells.

What is the maximum velocity in laminar pipe flow?

Twice the mean velocity, at the centreline, once the flow is fully developed: u(r) = 2U(1 − r²/R²). If your centreline velocity at the outlet is below 2U, the pipe is shorter than the development length, the run has not reached a steady state, or the radial mesh is too coarse.

Related on Skill-Lync

Sources

  • Hagen-Poiseuille flow: Y. A. Çengel and J. M. Cimbala, Fluid Mechanics: Fundamentals and Applications, 4th ed., Eqs. 8-18 (umax = 2U), 8-20 (Δp = 32μLU/D²), 8-22 and 8-23 (f = 8τw/ρU², f = 64/Re, hence τw = 8μU/D); transition at Re 2,300 and 4,000.
  • R. K. Shah, "A correlation for laminar hydrodynamic entry length solutions for circular and noncircular ducts", Journal of Fluids Engineering 100 (1978) 177-179: the fappRe correlation, in its general form as restated by Muzychka and Yovanovich, J. Fluids Eng. 131 (2009) 111105, Eq. 3, with the circular-tube constants (16, K(∞) = 1.25, C = 2.12 × 10⁻⁴) as tabulated from Incropera; K defined as in Shah and London (1978).
  • F. Durst, S. Ray, B. Ünsal, O. A. Bayoumi, "The development lengths of laminar pipe and channel flows", Journal of Fluids Engineering 127 (2005) 1154-1160: L/D = [0.6191.6 + (0.0567 Re)1.6]1/1.6, centreline velocity at 99%, as restated by Poole (J. Fluids Eng. 132, 2010, 064501) and Everts and Meyer (Exp. Thermal Fluid Sci. 118, 2020).
  • Entrance length rules: Çengel and Cimbala 4th ed., Eqs. 8-6 to 8-8 (0.05 Re D, wall shear within about 2%; 1.359 Re1/4 D; 10 D); 0.06 Re D and 4.4 Re1/6 D as quoted from F. M. White, Fluid Mechanics; H. L. Langhaar, Journal of Applied Mechanics 9 (1942) A55, 0.058 Re D as tabulated by Everts and Meyer 2020.
  • C. F. Colebrook, Journal of the ICE 11 (1939) 133; S. E. Haaland, Journal of Fluids Engineering 105 (1983) 89; P. K. Swamee and A. K. Jain, Journal of the Hydraulics Division ASCE 102 (1976) 657; forms as printed in Çengel and Cimbala §8-5 (Colebrook, Haaland Eq. 8-54).
  • OpenFOAM User Guide §4.2.2 (wedge: "a wedge of small angle (e.g. < 5°) and 1 cell thick", wedge planes as separate wedge patches); icoFoam.C and the cavity tutorial's p with dimensions [0 2 -2 0 0 0 0]; wedgePolyPatch.C (planarity and coordinate-plane checks). Run by Skill-Lync in the opencfd/openfoam-run:2412 image on 20 Nov 2026: blockMesh and checkMesh on this page's blockMeshDict at 2°, 4°, 10° and 45°, steady laminar simpleFoam on the course case, and the wallShearStress function object, written with dimensions [0 2 -2 0 0 0 0].
  • Water at 25 °C and 20 °C, 101.325 kPa: NIST Chemistry WebBook (997.05 and 998.21 kg/m³; 0.89002 and 1.0016 mPa·s). Air at 20 °C, 1 atm: Çengel and Cimbala Table A-9 (1.204 kg/m³, 1.825 × 10⁻⁵ Pa·s).
  • Skill-Lync, all 571 public OpenFOAM pipe-flow reports, read 20 Nov 2026: diameters, viscosities, entrance-length rules, pressure units.
  • Skill-Lync, scripts/verify/pipe-flow.py: re-implements every formula (Hagen-Poiseuille against a numerical integration, Colebrook by bisection, Shah's limits, the wedge geometry) and checks the OpenFOAM results; the page checks itself against it at build time.
Free counselling

From a pipe to a CFD career.

Validating a solver against an exact answer, knowing what the boundary conditions really impose and proving a mesh is fine enough are the everyday work of a CFD engineer. A Skill-Lync counsellor can map the course that fits the role you want.

Talk to a CFD course counsellor

Free. We call you back, usually the same day.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.