ForHosting KIT · Developer Utilities

Swamee-Jain friction factor calculator for turbulent pipe flow

This Swamee-Jain friction factor calculator estimates the dimensionless Darcy friction factor for turbulent flow in a circular pipe.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter the Reynolds number and the pipe's relative roughness, defined as absolute roughness divided by internal diameter. The calculator evaluates the explicit Swamee-Jain equation directly, so it does not need the iterative solution associated with the Colebrook equation. The result is useful for pressure-drop, head-loss, pump-sizing, and preliminary pipe-system calculations when the flow is turbulent and the input properties are already known.

What the Swamee-Jain result represents

The returned value is the Darcy friction factor, a dimensionless coefficient used in the Darcy-Weisbach equation for calculating pressure loss or head loss caused by wall friction. It is not the Fanning friction factor; the Darcy value is four times the Fanning value, so confirming the convention matters before inserting the result into another formula or software package. The Swamee-Jain equation is an explicit approximation to the turbulent-flow behavior described implicitly by the Colebrook equation. It combines two physical influences: the Reynolds number describes the balance between inertial and viscous effects, while relative roughness describes the size of wall irregularities compared with the pipe diameter. At moderate turbulent Reynolds numbers, both effects can influence the answer. At very large Reynolds numbers, roughness increasingly controls the friction factor. The calculator reports a dimensionless result and echoes both inputs, making the calculation easy to audit or pass into a larger hydraulic workflow without losing the values that produced it.

How to prepare the two inputs

Use a Reynolds number based on the pipe's mean flow velocity, internal diameter, fluid density, and dynamic viscosity, or the equivalent expression using kinematic viscosity. Every quantity used to form it must be dimensionally consistent. Relative roughness is epsilon divided by D, where epsilon is the pipe's absolute roughness and D is its internal diameter. Because this ratio is dimensionless, epsilon and D must be expressed in the same length unit; millimeters divided by millimeters works just as well as feet divided by feet. Do not enter absolute roughness by itself. For a hydraulically smooth pipe, use zero or an appropriately small relative-roughness estimate. The calculator requires a Reynolds number of at least 4,000 because the Swamee-Jain relationship is intended for turbulent flow, not laminar flow or the uncertain transition region. If a roughness value comes from a reference table, consider pipe age, deposits, corrosion, manufacturing method, and the actual internal diameter rather than relying only on the nominal pipe size.

Using the friction factor in engineering work

After calculating the friction factor, use it with the Darcy-Weisbach relationship to estimate distributed head loss, commonly written as friction factor multiplied by length-to-diameter ratio and velocity head. Pressure loss follows by multiplying head loss by the fluid's specific weight, with a consistent unit system throughout. The result covers straight-pipe wall friction; valves, bends, entrances, contractions, expansions, and other fittings usually require separate minor-loss coefficients or equivalent lengths. A single calculation is useful for checking a design point, while repeated calls can evaluate candidate diameters, flow rates, materials, or operating conditions. For critical designs, compare the explicit estimate with the method required by the governing standard, specification, or validated engineering software. Also assess uncertainty in roughness and fluid properties: a precise numerical output does not make uncertain inputs exact. The API price is $0.002 per request, and the deterministic calculation makes it suitable for reproducible spreadsheets, design services, teaching tools, and automated pipe-sizing workflows.

Estimate pipe pressure drop

Calculate the Darcy friction factor needed for a Darcy-Weisbach pressure-drop calculation at a known flow condition.

Compare pipe materials

Evaluate how different relative-roughness values affect friction when Reynolds number and pipe geometry are otherwise comparable.

Screen pump and diameter options

Use the explicit result in repeated preliminary calculations before performing a detailed hydraulic model or final equipment selection.

Which friction factor does the calculator return?

It returns the dimensionless Darcy friction factor. Divide it by four only if a downstream equation specifically requires the Fanning friction factor.

What is relative roughness?

Relative roughness is the pipe's absolute roughness epsilon divided by its internal diameter D. Use the same length unit for both quantities.

Can I use this equation for laminar flow?

No. The calculator requires Reynolds number to be at least 4,000. For fully developed laminar flow in a circular pipe, the Darcy friction factor is normally calculated as 64 divided by Reynolds number.

Is this the same as solving the Colebrook equation?

Not exactly. Swamee-Jain is an explicit approximation, while Colebrook is implicit and normally requires iteration. They are used for the same turbulent pipe-flow relationship but can produce slightly different values.

Does the result include losses from valves and bends?

No. The friction factor describes distributed wall friction in straight pipe. Add fitting and component losses separately using suitable minor-loss coefficients or equivalent lengths.

What does an API calculation cost?

Each API request costs $0.002. The calculation is deterministic and has no per-item surcharge.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/eng/friction-swamee

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/eng/friction-swamee \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"relative_roughness":0.0002,"reynolds_number":100000}'
{
  "relative_roughness": 0.0002,
  "reynolds_number": 100000
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "eng.friction_swamee",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →