Method: Joules.hydrostatic_pressure

Defined in:
lib/joules/pressure.rb

.hydrostatic_pressure(density, height) ⇒ Float

Calculates the hydrostatic pressure given density and height.

Examples:

Joules.hydrostatic_pressure(1000, 5) #=> 49050.0

Parameters:

  • density (Int, Float)

    density >= 0; density is in kilograms per metre cubed

  • height (Int, Float)

    height >= 0; height is in metres

Returns:

  • (Float)

    return value >= 0; return value is in pascals



43
44
45
# File 'lib/joules/pressure.rb', line 43

def hydrostatic_pressure(density, height)
  return density * FREE_FALL_ACCELERATION * height
end