DEV Community

Surendra Singh Kamboj
Surendra Singh Kamboj

Posted on AI-assisted

Venturi meter in JavaScript: find flow speed from a pressure difference

A venturi meter gives the flow speed from a pressure drop: v1 = sqrt(2 dP / (rho ((A1/A2)^2 - 1))). Here is the calculation, run in Node, for water in a pipe that narrows from 20 cm2 to 5 cm2.

How do you get the speed from the pressure difference?

Bernoulli's equation plus the continuity equation A1 v1 = A2 v2 give the formula above.

const rho = 1000;          // water, kg/m3
const A1 = 20e-4, A2 = 5e-4;   // m2
const dP = 2000;           // pressure drop between wide and narrow part, Pa
const v1 = Math.sqrt(2 * dP / (rho * ((A1 / A2) ** 2 - 1)));
const v2 = v1 * A1 / A2;
console.log(v1.toFixed(4), v2.toFixed(4));       // 0.5164 2.0656 m/s
console.log((v1 * A1 * 1e3).toFixed(4));         // 1.0328 litre/s
Enter fullscreen mode Exit fullscreen mode
Quantity Value
Speed in the wide part v1 0.5164 m/s
Speed in the throat v2 2.0656 m/s
Flow rate 1.0328 L/s

What happens if the pressure drop doubles?

The speed grows with the square root of dP, so doubling the drop raises the flow by a factor of 1.414, not 2.

FAQ: Why is the pressure lower in the narrow part?

The water speeds up there, so its kinetic energy per volume rises and the pressure energy per volume must fall.

I build PractiSci, a free-to-start virtual lab. You can try the venturi on screen: Bernoulli and venturi lab. Chapter guide: Mechanical properties of fluids.

Top comments (0)