When a fluid volume $V$ is displaced against an external pressure $p$, work must be done:
$$
W = F s
$$
This pressure is also referred to as piston pressure. Using the relationships $F = pA$ and $V = As$, we obtain:
$$
\boxed{E_\mathrm{stat} = pV}
$$
The work done, and thus the energy available, depends on the pressure and volume of the fluid.
If a volume of fluid is located at height $h$, it possesses the potential energy:
$$
E_\mathrm{pot} = mgh = \varrho V gh
$$
For a flowing fluid, the kinetic energy of a volume element is:
$$
E_\mathrm{kin} = \frac{1}{2}mv^2 = \frac{1}{2} \varrho V v^2
$$
According to the law of conservation of energy, the total energy of all three forms must remain constant:
$$
E_\mathrm{stat} + E_\mathrm{pot} + E_\mathrm{kin} = \text{const}
$$
Replacing the terms and canceling $V$, this leads to the total pressure:
$$
\boxed{p + \varrho g h + \frac{1}{2}\varrho v^2 = p_0}
$$
This is known as the Bernoulli equation. In words: the sum of static pressure $p$, dynamic pressure $\frac{1}{2}\varrho v^2$, and gravitational pressure $\varrho g h$ must always equal the original pressure $p_0$.
If, for example, the flow speed (and hence the dynamic pressure) changes, the static pressure must also change so that the equation remains valid.
Example: Water Column with a Hole
Let’s consider a water column with a hole at a distance $h$ below the water surface.
Inside the column, the water is approximately at rest, so the dynamic pressure is zero. However, the molecules have gravitational pressure $\varrho g h$.
As the water exits the hole, it now has dynamic pressure $\frac{1}{2}\varrho v^2$.
The static pressure $p$ from the surrounding air acts on the water on both sides and thus cancels out in the equation. So we get:
$$
\frac{1}{2}\varrho v^2 = \varrho g h
$$
Solving for $v$:
$$
\boxed{v = \sqrt{2gh}}
$$
This is the same velocity derived earlier from energy conservation for a mass falling from height $h$.
So the speed of water exiting the hole is equal to the speed of a freely falling object dropped from the same height.
Application to Gases
Although the Bernoulli equation strictly applies only to incompressible fluids, it also yields good approximations for gases at moderate speeds.
When air flows over a horizontal surface, the dynamic pressure increases and the static pressure decreases. The pressure is given by:
$$
p = p_0 - \frac{1}{2}\varrho v^2
$$
The resulting lift force acting on an area $A$ is:
$$
F = \frac{1}{2}\varrho v^2 A
$$
Hydrodynamic Paradox
The Bernoulli equation can be demonstrated using three vertical tubes (manometers) connected to a horizontal pipe.
This pipe narrows at the middle tube, causing the flow speed to increase, and thus the pressure to decrease in that region.
This results in a lower liquid level in the middle tube compared to the first.
In the ideal case (with no friction), the liquid level in the third tube would return to the height of the first one.
However, due to frictional losses, the level in the third tube remains lower than in the middle one.
This phenomenon is known as the hydrodynamic paradox.