Returns the elevation, pressure or velocity inside a fluid given the other two parameters.

You're viewing an older version of this page (#377). View the current version.

View versions (1)

Interface

#include <codecogs/engineering/fluids/imperial/bernoulli_inv.h>

using namespace Engineering::Fluids::Imperial;

This function uses the total energy E within a fluid along with its weight density \rho and, given two out of the three fluid parameters (elevation Z, pressure P, velocity v) it is able to calculate the third one using the simplifed Bernoulli equation:

Z + \frac{144 P}{\rho} + \frac{v^2}{2g} = E \mbox{ (constant)}
(1)

where g is the acceleration of gravity, 32.2 ft/s².

The example code below shows how this function acts as the inverse of the \ref{Engineering::Fluids::Imperial::Bernoulli} "Bernoulli" module, by computing each parameter on account of the other two, the total energy and the weight density of the fluid.

In order to return the desired parameter, the function takes a target argument which can be ELEVATION, PRESSURE or VELOCITY correspondingly. The value of the desired parameter as argument in the function call is ingored, but a convenient way is to denote it by a null value as you may notice in the given example code.

Example 1

#include <stdio.h>
#include <codecogs/engineering/fluids/imperial/bernoulli_inv.h>

int main()
{
  double
  Z = Engineering::Fluids::Imperial::Bernoulli_inv(ELEVATION,
  214.826817683595, 0.34, 0, 0.5, 2),
  P = Engineering::Fluids::Imperial::Bernoulli_inv(PRESSURE,
  214.826817683595, 0.34, 3, 0, 2),
  v = Engineering::Fluids::Imperial::Bernoulli_inv(VELOCITY,
  214.826817683595, 0.34, 3, 0.5, 0);

  printf("   Energy = 214.826817683595 ft\n");
  printf("  Density = 0.34 lb/ft^3\n\n");
  printf("Elevation = %.10lf ft\n", Z);
  printf(" Pressure = %.10lf lb/in^2\n", P);
  printf(" Velocity = %.10lf ft/s\n", v);

  return 0;
}

Output

Energy = 214.826817683595 ft
  Density = 0.34 lb/ft^3

Elevation = 3.0000000000 ft
 Pressure = 0.5000000000 lb/in^2
 Velocity = 2.0000000000 ft/s

Parameters

target
ELEVATION, PRESSURE or VELOCITY
energy
total head (ft)
density
weight density of fluid (lb/ft³)
elevation
potential head or elevation above reference level (ft)
pressure
pressure (lb/in²)
velocity
mean velocity of flow (ft/s)

Returns

The numerical value of the desired parameter.

References

The Engineering Division, Crane Co., "Flow of fluids through valves, fittings, and pipe", Chicago, 1957

GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

target
energy
density
elevation
pressure
velocity
Result