Skip to main content

bernoulli_pressure_kernel

Function bernoulli_pressure_kernel 

Source
pub fn bernoulli_pressure_kernel(
    p1: &Pressure,
    v1: &Speed,
    h1: &Length,
    v2: &Speed,
    h2: &Length,
    density: &Density,
) -> Result<Pressure, PhysicsError>
Expand description

Calculates pressure $P_2$ using Bernoulli’s principle.

$P_1 + \frac{1}{2}\rho v_1^2 + \rho g h_1 = P_2 + \frac{1}{2}\rho v_2^2 + \rho g h_2$

Solves for $P_2$: $P_2 = P_1 + \frac{1}{2}\rho(v_1^2 - v_2^2) + \rho g(h_1 - h_2)$

§Arguments

  • p1 - Pressure at point 1.
  • v1 - Velocity at point 1.
  • h1 - Elevation at point 1.
  • v2 - Velocity at point 2.
  • h2 - Elevation at point 2.
  • density - Fluid density.

§Returns

  • Ok(Pressure) - Pressure at point 2.